Browse code

Make avfilter_config_links() propagate audio information of the source link if it is not explicitely set by the filter.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>

Stefano Sabatini authored on 2011/02/14 06:59:55
Showing 1 changed files
... ...
@@ -198,6 +198,12 @@ int avfilter_config_links(AVFilterContext *filter)
198 198
                 link->sample_aspect_ratio = link->src->input_count ?
199 199
                     link->src->inputs[0]->sample_aspect_ratio : (AVRational){1,1};
200 200
 
201
+            if (link->sample_rate == 0 && link->src && link->src->input_count)
202
+                link->sample_rate = link->src->inputs[0]->sample_rate;
203
+
204
+            if (link->channel_layout == 0 && link->src && link->src->input_count)
205
+                link->channel_layout = link->src->inputs[0]->channel_layout;
206
+
201 207
             if ((config_link = link->dstpad->config_props))
202 208
                 if ((ret = config_link(link)) < 0)
203 209
                     return ret;