[FFmpeg-devel] [PATCH] avformat/riffdec: add ch_layout used av_channel_layout_default.

James Almer jamrial at gmail.com
Thu May 9 05:30:26 EEST 2024


On 5/8/2024 11:28 PM, shiqizhu wrote:
> Signed-off-by: shiqizhu <hiccupzhu at gmail.com>
> ---
>   libavformat/riffdec.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/libavformat/riffdec.c b/libavformat/riffdec.c
> index b7a85a6ab2..89267e879d 100644
> --- a/libavformat/riffdec.c
> +++ b/libavformat/riffdec.c
> @@ -197,8 +197,7 @@ int ff_get_wav_header(void *logctx, AVIOContext *pb,
>       /* ignore WAVEFORMATEXTENSIBLE layout if different from channel count */
>       if (channels != par->ch_layout.nb_channels) {
>           av_channel_layout_uninit(&par->ch_layout);
> -        par->ch_layout.order       = AV_CHANNEL_ORDER_UNSPEC;
> -        par->ch_layout.nb_channels = channels;
> +        av_channel_layout_default(&par->ch_layout, channels);

No, guessing is left to the caller. lavf should export what's signaled 
in the file.


More information about the ffmpeg-devel mailing list