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

Alexander Strasser <[email protected]> Sun, 7 Apr 2024 11:40:26 +0200
Newsgroups gmane.comp.video.mplayer.devel
Message-ID <ZhJqCrr4a_Qi__Ix@metallschleimette>
Hi Ivan!

On 2024-04-07 02:27 +0300, Ivan Kalvachev wrote:
> I'm not familiar with the code, but the following looks fishy.

Agree, I fear something went wrong over time in that code.
As I'm not really familiar I just wanted to do the minimal fixes,
but now I think it's better to do a bit more.


> 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.

Good catch, that is a copy and paste error on my part :(


> 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;

While editing the code first time I thought the waveformat branch in
ad ffmpeg looked wrong. Now I see this it definitely looks wrong to
me. I will attempt a re-work and hopefully send v2 of this patch set
later today.

I have some hope it might also fix the problems reported by Ingo.


Best regards,
  Alexander
_______________________________________________
MPlayer-dev-eng mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/mplayer-dev-eng