[FFmpeg-devel] [PATCH] Handle ID3v1 tag while decoding mp[123] frames

Anton Khirnov anton
Mon Jan 10 15:50:14 CET 2011


On Sat, Jan 08, 2011 at 01:43:13AM +0100, Michael Niedermayer wrote:
> On Sat, Jan 08, 2011 at 12:58:55AM +0100, Cl?ment B?sch wrote:
> > On Fri, Jan 07, 2011 at 03:41:18AM +0100, Michael Niedermayer wrote:
> > > On Fri, Jan 07, 2011 at 02:40:14AM +0100, Cl?ment B?sch wrote:
> > > > [...]
> > > >  mpegaudiodec.c |    9 +++++++++
> > > >  1 file changed, 9 insertions(+)
> > > > a91239b090f15a3761ab97fe3ff121d4e991cd0c  0001-Handle-ID3v1-tag-while-decoding-mp-123-frames.patch
> > > > From 6b291325a850f098568afcac915aeed11a2cc219 Mon Sep 17 00:00:00 2001
> > > > From: =?UTF-8?q?Cl=C3=A9ment=20B=C5=93sch?= <ubitux at gmail.com>
> > > > Date: Fri, 7 Jan 2011 02:27:25 +0100
> > > > Subject: [PATCH] Handle ID3v1 tag while decoding mp[123] frames
> > > > 
> > > > ---
> > > >  libavcodec/mpegaudiodec.c |    9 +++++++++
> > > >  1 files changed, 9 insertions(+), 0 deletions(-)
> > > > 
> > > > diff --git a/libavcodec/mpegaudiodec.c b/libavcodec/mpegaudiodec.c
> > > > index 769be89..fe84214 100644
> > > > --- a/libavcodec/mpegaudiodec.c
> > > > +++ b/libavcodec/mpegaudiodec.c
> > > > @@ -27,6 +27,7 @@
> > > >  #include "avcodec.h"
> > > >  #include "get_bits.h"
> > > >  #include "dsputil.h"
> > > > +#include "libavformat/id3v1.h"
> > > >  
> > > >  /*
> > > >   * TODO:
> > > > @@ -2043,6 +2044,14 @@ static int decode_frame(AVCodecContext * avctx,
> > > >  
> > > >      header = AV_RB32(buf);
> > > >      if(ff_mpa_check_header(header) < 0){
> > > > +
> > > > +        if (buf_size == ID3v1_TAG_SIZE
> > > > +            && buf[0] == 'T' && buf[1] == 'A' && buf[2] == 'G') {
> > > 
> > > > +            avpkt->data += ID3v1_TAG_SIZE;
> > > > +            avpkt->size = 0;
> > > 
> > > These 2 look wrong, decoders are not supposed to change them
> > > 
> > 
> > Ok, this version may be better then.
> > 
> > Btw, I forgot to mentioned in my last mail this also fixed the annoying
> > "Header missing" error on every mp3 with a id3v1 tag at the end of the
> > file.
> > 
> > -- 
> > Cl?ment B.
> 
> >  mpegaudiodec.c |    8 ++++++++
> >  1 file changed, 8 insertions(+)
> > 0895d021aeb4149afd527e473cfa931b7aabc999  0001-Handle-ID3v1-tag-while-decoding-mp-123-frames.patch
> > From 4583289f489b3014b88ba77da20470b8d9f60ceb Mon Sep 17 00:00:00 2001
> > From: =?UTF-8?q?Cl=C3=A9ment=20B=C5=93sch?= <ubitux at gmail.com>
> > Date: Fri, 7 Jan 2011 02:27:25 +0100
> > Subject: [PATCH] Handle ID3v1 tag while decoding mp[123] frames
> 
> lgtm if tested
applied

-- 
Anton Khirnov
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20110110/5adea3e2/attachment.pgp>



More information about the ffmpeg-devel mailing list