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

Nicolas George nicolas.george at normalesup.org
Thu Mar 14 23:33:14 CET 2013

Le quartidi 24 ventôse, an CCXXI, Hendrik Leppkes a écrit :
> 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
> this.
> So, before this is the case, i'm quite sure it would cause severe
> regressions, even if none appear in FATE.

I do not think it can cause severe regressions, because they would only
happen in cases that currently, more or less, do not work. You can not
regress from "do now work".

For the command-line tool, that is totally true: transcoding files with
unknown layouts do not work, period. This fact is hidden by ffmpeg
"guessing" an imaginary channel layout, but using -guess_layout_max 0 will
make it obvious. Note that it did work for slightly less than two months, so
this in itself is a regression, and this patch addresses it.

At the API level, things are less clear, and will depend on how complex the
program using the API is, but a lot of things will just not work with
unknown layouts.

OTOH, I do not mind delaying this patch a little so I can find various
places where the layout is used unconditionally.


  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130314/b78d4faf/attachment.asc>

More information about the ffmpeg-devel mailing list