]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/avfilter.c
Merge commit 'e48746deec48e9ff195841bc3266b4e153a878cd'
[ffmpeg] / libavfilter / avfilter.c
index b2365354a2ae50e1d262dd488635d460dc767ace..662f93304135b0906839e78f306efc62530c732f 100644 (file)
@@ -316,14 +316,6 @@ int avfilter_config_links(AVFilterContext *filter)
                     link->time_base = (AVRational) {1, link->sample_rate};
             }
 
-            if ((config_link = link->dstpad->config_props))
-                if ((ret = config_link(link)) < 0) {
-                    av_log(link->dst, AV_LOG_ERROR,
-                           "Failed to configure input pad on %s\n",
-                           link->dst->name);
-                    return ret;
-                }
-
             if (link->src->nb_inputs && link->src->inputs[0]->hw_frames_ctx &&
                 !link->hw_frames_ctx) {
                 AVHWFramesContext *input_ctx = (AVHWFramesContext*)link->src->inputs[0]->hw_frames_ctx->data;
@@ -335,6 +327,14 @@ int avfilter_config_links(AVFilterContext *filter)
                 }
             }
 
+            if ((config_link = link->dstpad->config_props))
+                if ((ret = config_link(link)) < 0) {
+                    av_log(link->dst, AV_LOG_ERROR,
+                           "Failed to configure input pad on %s\n",
+                           link->dst->name);
+                    return ret;
+                }
+
             link->init_state = AVLINK_INIT;
         }
     }
@@ -1120,7 +1120,7 @@ static int ff_filter_frame_framed(AVFilterLink *link, AVFrame *frame)
     pts = out->pts;
     if (dstctx->enable_str) {
         int64_t pos = av_frame_get_pkt_pos(out);
-        dstctx->var_values[VAR_N] = link->frame_count;
+        dstctx->var_values[VAR_N] = link->frame_count_out;
         dstctx->var_values[VAR_T] = pts == AV_NOPTS_VALUE ? NAN : pts * av_q2d(link->time_base);
         dstctx->var_values[VAR_W] = link->w;
         dstctx->var_values[VAR_H] = link->h;
@@ -1132,7 +1132,7 @@ static int ff_filter_frame_framed(AVFilterLink *link, AVFrame *frame)
             filter_frame = default_filter_frame;
     }
     ret = filter_frame(link, out);
-    link->frame_count++;
+    link->frame_count_out++;
     ff_update_link_current_pts(link, pts);
     return ret;
 
@@ -1221,6 +1221,7 @@ int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
     }
 
     link->frame_wanted_out = 0;
+    link->frame_count_in++;
     /* Go directly to actual filtering if possible */
     if (link->type == AVMEDIA_TYPE_AUDIO &&
         link->min_samples &&