Commit 0db48ee4 authored by Marton Balint's avatar Marton Balint

avfilter/af_amerge: properly handle unknown input layouts

Reviewed-by: 's avatarNicolas George <george@nsup.org>
Signed-off-by: 's avatarMarton Balint <cus@passwd.hu>
parent d5ecffba
...@@ -96,10 +96,15 @@ static int query_formats(AVFilterContext *ctx) ...@@ -96,10 +96,15 @@ static int query_formats(AVFilterContext *ctx)
av_get_channel_layout_string(buf, sizeof(buf), 0, inlayout[i]); 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); 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]); s->in[i].nb_ch = FF_LAYOUT2COUNT(inlayout[i]);
if (outlayout & inlayout[i]) if (s->in[i].nb_ch) {
overlap++; 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; nb_ch += s->in[i].nb_ch;
} }
if (nb_ch > SWR_CH_MAX) { if (nb_ch > SWR_CH_MAX) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment