[FFmpeg-devel] [PATCH] [2/2] add the id3v2 parsing for adts aac, take 4

Michael Niedermayer michaelni
Wed Jun 17 02:20:06 CEST 2009


On Fri, Jun 12, 2009 at 11:02:56PM +0200, Patrick Dehne wrote:
> Michael Niedermayer <michaelni at gmx.at> writes:
> 
> > On Fri, Jun 12, 2009 at 10:32:50AM +0200, Patrick Dehne wrote:
> >
> > [...]
> >> +/* 'buf' must be ID3v1_TAG_SIZE byte long */
> >> +static int parse_tag(AVFormatContext *s, const uint8_t *buf)
> >
> > comment is not doxygen compatible
> 
> fixed
[...]
> Index: libavformat/raw.c
> ===================================================================
> --- libavformat/raw.c	(revision 19171)
> +++ libavformat/raw.c	(working copy)
> @@ -27,6 +27,7 @@
>  #include "avformat.h"
>  #include "raw.h"
>  #include "id3v2.h"
> +#include "id3v1.h"
>  
>  /* simple formats */
>  
> @@ -625,6 +626,26 @@
>      else if(max_frames>=1) return 1;
>      else                   return 0;
>  }
> +
> +static int adts_aac_read_header(AVFormatContext *s,
> +                                AVFormatParameters *ap)
> +{
> +    AVStream *st;
> +
> +    st = av_new_stream(s, 0);
> +    if (!st)
> +        return AVERROR(ENOMEM);
> +
> +    st->codec->codec_type = CODEC_TYPE_AUDIO;
> +    st->codec->codec_id = s->iformat->value;
> +    st->need_parsing = AVSTREAM_PARSE_FULL;
> +
> +    ff_id3v1_read(s);
> +    ff_id3v2_read(s);
> +
> +    return 0;
> +}
> +
>  #endif
>  
>  /* Note: Do not forget to add new entries to the Makefile as well. */
> @@ -635,7 +656,7 @@
>      NULL_IF_CONFIG_SMALL("raw ADTS AAC"),
>      0,
>      adts_aac_probe,
> -    audio_read_header,
> +    adts_aac_read_header,
>      ff_raw_read_partial_packet,
>      .flags= AVFMT_GENERIC_INDEX,
>      .extensions = "aac",

moving code and functional changes must be in seperate patches

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Old school: Use the lowest level language in which you can solve the problem
            conveniently.
New school: Use the highest level language in which the latest supercomputer
            can solve the problem without the user falling asleep waiting.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090617/dd550393/attachment.pgp>



More information about the ffmpeg-devel mailing list