[FFmpeg-devel] [PATCH] avformat/wavdec: change ch_layout used av_channel_layout_default.
Marton Balint
cus at passwd.hu
Wed May 8 22:41:23 EEST 2024
On Wed, 8 May 2024, shiqizhu wrote:
> Signed-off-by: shiqizhu <hiccupzhu at gmail.com>
> ---
> libavformat/wavdec.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/libavformat/wavdec.c b/libavformat/wavdec.c
> index 00856a5eca..9060796c81 100644
> --- a/libavformat/wavdec.c
> +++ b/libavformat/wavdec.c
> @@ -233,8 +233,7 @@ static int wav_parse_xma2_tag(AVFormatContext *s, int64_t size, AVStream *st)
> avio_skip(pb, 3);
> }
> av_channel_layout_uninit(&st->codecpar->ch_layout);
> - st->codecpar->ch_layout.order = AV_CHANNEL_ORDER_UNSPEC;
> - st->codecpar->ch_layout.nb_channels = channels;
> + av_channel_layout_default(&st->codecpar->ch_layout, channels);
Why do you assume that the default layout is suitable here? A demuxer
should not guess the channel layout, if the format does not provide any
information about it.
Regards,
Marton
More information about the ffmpeg-devel
mailing list