diff options
author | Marton Balint <cus@passwd.hu> | 2016-12-15 03:28:20 +0100 |
---|---|---|
committer | Marton Balint <cus@passwd.hu> | 2016-12-25 21:10:03 +0100 |
commit | 0db48ee4257c16f583b7b077fdbd13cfd0b9f037 (patch) | |
tree | fc8cf369e99e543e0af073d94e3e1937b631e37d /libavfilter | |
parent | d5ecffbac69543185a2f6d91414dbe097645f62c (diff) | |
download | ffmpeg-0db48ee4257c16f583b7b077fdbd13cfd0b9f037.tar.gz |
avfilter/af_amerge: properly handle unknown input layouts
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/af_amerge.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/libavfilter/af_amerge.c b/libavfilter/af_amerge.c index 40bf7ab209..8ea01e206b 100644 --- a/libavfilter/af_amerge.c +++ b/libavfilter/af_amerge.c @@ -96,10 +96,15 @@ static int query_formats(AVFilterContext *ctx) av_get_channel_layout_string(buf, sizeof(buf), 0, inlayout[i]); av_log(ctx, AV_LOG_INFO, "Using \"%s\" for input %d\n", buf, i + 1); } - s->in[i].nb_ch = av_get_channel_layout_nb_channels(inlayout[i]); - if (outlayout & inlayout[i]) + s->in[i].nb_ch = FF_LAYOUT2COUNT(inlayout[i]); + if (s->in[i].nb_ch) { overlap++; - outlayout |= inlayout[i]; + } else { + s->in[i].nb_ch = av_get_channel_layout_nb_channels(inlayout[i]); + if (outlayout & inlayout[i]) + overlap++; + outlayout |= inlayout[i]; + } nb_ch += s->in[i].nb_ch; } if (nb_ch > SWR_CH_MAX) { |