[FFmpeg-devel] [PATCH 1/5] avutil/channel_layout: add 22.2 layout

Jan Ekström jeebjp at gmail.com
Sun Aug 2 17:22:07 EEST 2020


On Sat, Aug 1, 2020 at 4:44 PM Jan Ekström <jeebjp at gmail.com> wrote:
>
> > > At this point I would not like to attempt to figure out how to skip
> > > channel coding units in the AAC decoder
> >
> > Just throw them away?
> >
>
> Very easy to say in words, but I am not sure how simple this is in the
> code. That said, if you are interested in implementing this in the
> decoder, I am not opposed to the idea since in this specific case the
> spec seems to note that 5.1 can be mapped into those channels.
>

I took a quick look at output_configure in aacdec_template, and it
isn't too clear what's the best way of getting this done.

The more proper way would seem to be to see if sniff_channel_order
returned a layout, and then proceed to applying a switch/case thing
for request_channel_layout. But more looking into the decoder would be
required to figure out if one can get it done with:
A. Just zero out mappings past the needed coding units.
B. A and resetting the tags count within output_configure (since that
is a parameter received from an outer function)
C. Something else?

Alternatively, something similar to B could get received by having the
switch/case just before the get_new_frame check, and just overriding
the layout and channels variables.

The problem is that I'm not sure how well the best working alternative
of these will work:
A. Not at all, since it will attempt to pull in data for 24 channels
but the AVFrame only contains 6. Segfault.
B. Kind of. 24 channels will get allocated, but layout is 5.1.
C. ???

I hope this clears up why I'm not too interested in trying to figure
this out right now, since I have just been able to figure out the base
decoding (which is currently everything the decoder supports!) and
downmix through swresample.

Jan


More information about the ffmpeg-devel mailing list