[FFmpeg-devel] [PATCH 1/3] lavc: do not init frame with guessed layout.

Hendrik Leppkes h.leppkes at gmail.com
Thu Mar 14 23:18:02 CET 2013

On Thu, Mar 14, 2013 at 10:39 PM, Nicolas George
<nicolas.george at normalesup.org> wrote:
> Le quartidi 24 ventôse, an CCXXI, Hendrik Leppkes a écrit :
>> This seems rather risky because the layout is used in quite some places to
>> determine the actual number of channels in a frame.
> That is true, but if it happens, it is a bug that needs fixing.
> I can confirm that with the patches I sent so far, FATE (at least the tests
> enabled by my setup) and transcoding unknown layouts succeed. So at least,
> it does not break something currently supported and helps to support new
> things (which were requested).

I just did a quick grep, and its used in very critical parts that
would immediately break if you combine planar audio with unknown
channel layout, because its used to allocate the planar data buffers.

If frames with unknown channel layout are supposed to be supported,
those cases should definitely be changed first to use
AVFrame->channels. The fork doesn't have have channels and relys on
channel_layout alone, which is why its used in all critical parts.
Basically, all cases where av_get_channel_layout_nb_channels is used
in avutil/frame.c and quite some in avfilter would be affected by

So, before this is the case, i'm quite sure it would cause severe
regressions, even if none appear in FATE.

- Hendrik

More information about the ffmpeg-devel mailing list