[MPlayer-dev-eng] [RFC][PATCH 4/8] Switch to FFmpeg AVChannelLayout

Ivan Kalvachev ikalvachev at gmail.com
Sun Apr 7 02:27:51 EEST 2024


I'm not familiar with the code, but the following looks fishy.

On Thu, Apr 4, 2024 at 1:40 AM Alexander Strasser <eclipse7 at gmx.net> wrote:
> --- a/libmpcodecs/ad_ffmpeg.c
> +++ b/libmpcodecs/ad_ffmpeg.c
[...]
> -    lavc_context->channel_layout = sh_audio->channel_layout;
> -    lavc_context->request_channel_layout = av_get_default_channel_layout(audio_output_channels);
> +    lavc_context->ch_layout.nb_channels = sh_audio->channel_layout;

It puts "layout" into "number of channels", and that overwrites the
value filled right before that.
Later I see example of the code that reads the "layout" from "ch_layout mask".

> --- a/libmpdemux/demux_lavf.c
> +++ b/libmpdemux/demux_lavf.c
> +            wf->nChannels= codec->ch_layout.nb_channels;
> +            sh_audio->channel_layout = codec->ch_layout.u.mask;

Best Regards
   Ivan Kalvachev


More information about the MPlayer-dev-eng mailing list