lavfi: when configuring a link, set channel layout from previous link if unspecified
authorStefano Sabatini <stefasab@gmail.com>
Fri, 31 Aug 2012 21:55:11 +0000 (23:55 +0200)
committerStefano Sabatini <stefasab@gmail.com>
Sun, 2 Sep 2012 08:42:25 +0000 (10:42 +0200)
In avfilter_config_links(), if the current channel layout is not
specified, set the same value of the previous link in the filterchain.

Consistent with the logic used to set the other link parameters.

libavfilter/avfilter.c

index d05d4ea..3bac29d 100644 (file)
@@ -277,6 +277,8 @@ int avfilter_config_links(AVFilterContext *filter)
                         link->sample_rate = inlink->sample_rate;
                     if (!link->time_base.num && !link->time_base.den)
                         link->time_base = inlink->time_base;
+                    if (!link->channel_layout)
+                        link->channel_layout = inlink->channel_layout;
                 } else if (!link->sample_rate) {
                     av_log(link->src, AV_LOG_ERROR,
                            "Audio source filters must set their output link's "