[FFmpeg-devel] [PATCH] code to parse mpeg4audio extradata

Baptiste Coudurier baptiste.coudurier
Wed Mar 19 17:49:51 CET 2008


Andreas ?man wrote:
> Baptiste Coudurier wrote:
>> Hi,
>>
>> Here is a patch that adds parsing of mpeg4audio extradata, and retrieve
>> needed infos for decoders (only mp3on4 atm, but will be needed for aac),
>> and will be used by mov demuxer ideally to correctly compute sample rate
>> and channels.
>> Also extract common mpeg4audio code from aac_parser.c.
> 
> Sorry for the inadequate quoting, my thunderbird cannot inline the
> patch correctly... :/

You have to downgrade to 1.5 if you want patches inlined. Don't ask me
why :>

> +            c->ext_sample_rate = get_bits(&gb, 24);
> +        else
> +            c->ext_sample_rate = 
> ff_mpeg4audio_sample_rates[c->sampling_index];
> +        if ((c->object_type = get_bits(&gb, 5)) == 31)
> +            c->object_type = 32 + get_bits(&gb, 6);
> +    }
> 
> GASpecificConfig() resides here, so either we need to add a callback,
> or the function must be split (at least for aac.c to use this)

Yes, it can be extended this way I think.

int ff_mpeg4audio_get_config(MPEG4AudioConfig *c, const uint8_t *buf,
int buf_size, int (*specific_config)(), void *v);

...

if (specific_config && specific_config(gb, v) < 0)
    return -1;

What do you think ?

> But without specific parser for all used audioObjectTypes i don't see
> how the code below here is supposed to work at all (since it will
> read the wrong bits)

Yes, probably, if we want to support all configurations and modes, it
will to be extended for sure, also maybe code could search syncword.

-- 
Baptiste COUDURIER                              GnuPG Key Id: 0x5C1ABAAA
SMARTJOG SAS                                     http://www.smartjog.com
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
Phone: +33 1 49966312





More information about the ffmpeg-devel mailing list