Commit 4721b9f1 authored by Marton Balint's avatar Marton Balint

avfilter/buffersrc: never override channel count in av_buffersrc_add_frame_flags

Overriding unknown layouts with the negotiated layout is OK, but the number of
channels should match with what was negotiated.
Signed-off-by: 's avatarMarton Balint <cus@passwd.hu>
parent 359b6a7f
......@@ -215,7 +215,7 @@ int attribute_align_arg av_buffersrc_add_frame_flags(AVFilterContext *ctx, AVFra
break;
case AVMEDIA_TYPE_AUDIO:
/* For layouts unknown on input but known on link after negotiation. */
if (frame->ch_layout.order == AV_CHANNEL_ORDER_UNSPEC) {
if (frame->ch_layout.order == AV_CHANNEL_ORDER_UNSPEC && frame->ch_layout.nb_channels == s->ch_layout.nb_channels) {
ret = av_channel_layout_copy(&frame->ch_layout, &s->ch_layout);
if (ret < 0)
return ret;
......
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