Re: [RFC][PATCH 4/8] Switch to FFmpeg AVChannelLayout

Ivan Kalvachev <[email protected]> Sun, 7 Apr 2024 02:27:51 +0300
Newsgroups gmane.comp.video.mplayer.devel
Message-ID <CABA=pqdfH_xuvaWha8U7LJYdzRvcCKRqyY5MyF=r-rL6M=v8WA@mail.gmail.com>
I'm not familiar with the code, but the following looks fishy.

On Thu, Apr 4, 2024 at 1:40 AM Alexander Strasser <[email protected]> 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
_______________________________________________
MPlayer-dev-eng mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/mplayer-dev-eng