[FFmpeg-devel] [PATCH] ac3_parser type punning fix

Måns Rullgård mans
Mon Oct 20 00:07:00 CEST 2008


Michael Niedermayer <michaelni at gmx.at> writes:

> On Sun, Oct 19, 2008 at 12:26:31PM -0700, Baptiste Coudurier wrote:
>> Hi guys,
>> 
>> Michael Niedermayer wrote:
>> > On Sun, Oct 19, 2008 at 05:23:52PM +0100, M?ns Rullg?rd wrote:
>> >> Michael Niedermayer <michaelni at gmx.at> writes:
> [...]
>> >> Looking at the code, I see one significant difference between
>> >> aac_sync() and ac3_sync().  Whereas aac_sync() only calls inlined
>> >> get_bits() functions (meaning gcc can know exactly what accesses are
>> >> happening), ac3_sync() calls another function to do the parsing.  In
>> >> light of this, I agree it's unlikely that gcc is able to exploit any
>> >> aliasing tricks.  The disassembly above also suggests that something
>> >> more sinister is afoot here.
>> >>
>> >> The change to aac_sync() fixed a real aliasing violation, and I
>> >> verified the assembler before and after the change.  This seems to be
>> >> a bit different.
>> > 
>> 
>> FYI, Mans and I talked about this issue some time ago, and then I filled
>> a roundup issue regarding this (raw aac playback is broken)
>
> i cant find that issue, do you maybe know its number or a search term that
> works?
>
>> 
>> Even at r15647 raw aac is still borken because the parser is still broken.
>
> i dont know about the parser but raw aac is broken because
> the aac decoder does
>     if (avccontext->extradata_size <= 0 ||
>         decode_audio_specific_config(ac, avccontext->extradata, avccontext->extradata_size))
>         return -1;
>
> and nothing in raw.c nor in the parser sets extradata, nor is there a 
> AVCodecParser.split() that would cause extradata to be set.
> Thats also why aac in mpeg-ts does not work ...

The decoder should get whatever it needs from the ADTS frame headers.
It looks like Rob only bothered to implemented the format used in
mp4-like containers.

-- 
M?ns Rullg?rd
mans at mansr.com




More information about the ffmpeg-devel mailing list