diff options
author | Marton Balint <cus@passwd.hu> | 2024-03-31 20:28:13 +0200 |
---|---|---|
committer | Marton Balint <cus@passwd.hu> | 2024-04-09 23:12:46 +0200 |
commit | 4721b9f15fc8487d718cce918f51db5b7734a942 (patch) | |
tree | 5311e4bcca628bab2cbf7248671afe0cd180f5b6 | |
parent | 359b6a7f8aec3736451f5179deb98f173fbff0dd (diff) | |
download | ffmpeg-4721b9f15fc8487d718cce918f51db5b7734a942.tar.gz |
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: Marton Balint <cus@passwd.hu>
-rw-r--r-- | libavfilter/buffersrc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavfilter/buffersrc.c b/libavfilter/buffersrc.c index bfe459c8aa..a61960310b 100644 --- a/libavfilter/buffersrc.c +++ b/libavfilter/buffersrc.c @@ -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; |