[libav-devel] [PATCH 1/2] latmdec: fix audio specific config parsing
Janne Grunau
janne-libav at jannau.net
Thu Nov 10 12:58:03 CET 2011
On Tue, Nov 08, 2011 at 01:05:37PM -0800, Alex Converse wrote:
> On Fri, Oct 28, 2011 at 6:17 AM, Janne Grunau <janne-libav at jannau.net> wrote:
> > Pass the correct size in bits to mpeg4audio_get_config and add a flag
> > to disable parsing of the sync extension when the size is not known.
> >
> > Latm with AudioMuxVersion 0 does not specify the size of the audio
> > specific config. Data after the audio specific config can be
> > misinterpreted as sync extension resulting in random and wrong configs.
> >
> > Since all other users og avpriv_mpeg4audio_get_config know the size
> > in bytes and have zero padding after the config a wrapper function
> > is added to retain API/ABI compatibility.
> > ---
> > libavcodec/aacdec.c | 33 +++++++++++++++++++++------------
> > libavcodec/mpeg4audio.c | 13 ++++++++++---
> > libavcodec/mpeg4audio.h | 12 ++++++++++++
> > 3 files changed, 43 insertions(+), 15 deletions(-)
> >
>
> I'm still OK with this as-is but...
>
> > --- a/libavcodec/mpeg4audio.c
> > +++ b/libavcodec/mpeg4audio.c
> > @@ -76,12 +76,13 @@ static inline int get_sample_rate(GetBitContext *gb, int *index)
> > avpriv_mpeg4audio_sample_rates[*index];
> > }
> >
> > -int avpriv_mpeg4audio_get_config(MPEG4AudioConfig *c, const uint8_t *buf, int buf_size)
> > +int ff_mpeg4audio_get_config(MPEG4AudioConfig *c, const uint8_t *buf,
> > + int bit_size, int sync_extension)
> > {
>
> If renaming 'ff_mpeg4audio_get_config' to
> 'avpriv_mpeg4audio_get_config' in
> 59a9a235811dc5f6a2c8b631a320968a06a867d1 was ok then maybe this
> wrapper business is unnecessary.
I've changed it to the wrapper since it was easier as I had to modify
another parameter.
We don't provide api stability garanties for private functions used in
a different libav* library.
I'll resubmit the pach without the wrapper.
Janne
More information about the libav-devel
mailing list