[FFmpeg-devel] [PATCH] Allow autodetecting PS and SBR for AAC without extradata.

Reimar Döffinger Reimar.Doeffinger at gmx.de
Thu Aug 11 07:50:43 CEST 2011

On 10 Aug 2011, at 21:46, Michael Niedermayer <michaelni at gmx.at> wrote:
> On Wed, Aug 10, 2011 at 09:04:40PM +0200, Reimar Döffinger wrote:
>> On Tue, Aug 09, 2011 at 07:57:54PM +0200, Reimar Döffinger wrote:
>>> This was possible before and was broken when this code was added.
>> Note that without this all SBR streams in e.g. MPEG-TS and raw
>> are broken, e.g.
>> http://www.datafilehost.com/download-88c5d6fe.html
>> (only tested the raw stream created from that file in ffplay though
>> to confirm the fix is necessary and sufficient,
>> complete file itself was tested with mplayer -demuxer lavf).
> Please explain the bug and how this change fixes it

This new code makes up a configuration which, probably by chance due to 0-initialisation, makes up a config that includes SBR and PS disabled, and then sets the configuration to locked.
When it then encounters an in-stream header that says SBR or PS should be enabled it prints an error and refuses to change them because the configuration is locked (it actually claims that setting SBR was attempted after the first frame, but that is inaccurate in that case), and the remaining decode is a mess due to using wrong decode parameters.
The patch sets SBR/PS values to the "auto detect" default like some other code distributed over the code base also does, and it does not lock the configuration so that information from in-stream headers will still be accepted - since we "made up" the configuration we certainly shouldn't ignore them, assuming they are a result of bitstream corruption as the current code does.

More information about the ffmpeg-devel mailing list