lavfi: set the link hwframes context before configuring the dst input
authorAnton Khirnov <anton@khirnov.net>
Tue, 21 Jun 2016 17:39:51 +0000 (19:39 +0200)
committerAnton Khirnov <anton@khirnov.net>
Sat, 25 Jun 2016 09:11:46 +0000 (11:11 +0200)
The destination filter might expect the hw frames context to be already
set (this is the case e.g. for hwdownload).

libavfilter/avfilter.c

index 190d8ab..1cedb15 100644 (file)
@@ -211,14 +211,6 @@ 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;
-                }
-
             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;
@@ -230,6 +222,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;
         }
     }