[FFmpeg-devel] [PATCH 1/3] lavf/id3v2 read COMM tag

Matthieu Bouron matthieu.bouron at gmail.com
Sun Jul 1 20:32:29 CEST 2012


On Sun, Jul 01, 2012 at 04:23:32PM +0200, Michael Niedermayer wrote:
> On Sun, Jul 01, 2012 at 11:16:41AM +0200, Matthieu Bouron wrote:
> > ---
> >  libavformat/id3v2.c | 37 +++++++++++++++++++++++++++++++++++++
> >  1 file changed, 37 insertions(+)
> > 
> > diff --git a/libavformat/id3v2.c b/libavformat/id3v2.c
> > index 216d4a2..cb88858 100644
> > --- a/libavformat/id3v2.c
> > +++ b/libavformat/id3v2.c
> > @@ -505,6 +505,42 @@ fail:
> >      avio_seek(pb, end, SEEK_SET);
> >  }
> >  
> > +static void read_comm(AVFormatContext *s, AVIOContext *pb, int taglen, char *tag, ID3v2ExtraMeta **extra_meta)
> > +{
> > +    uint8_t* dst = NULL;
> > +    int64_t end = avio_tell(pb) + taglen;
> > +    uint8_t encoding;
> > +
> > +    if (taglen <= 4)
> > +        goto fail;
> > +
> > +    encoding = avio_r8(pb);
> > +    taglen--;
> > +
> > +    // Read lang
> > +    avio_rb24(pb);
> 
> why is the language code discarded ?
> 
> 
> > +    taglen -= 3;
> > +
> > +    // Read short description
> > +    if (decode_str(s, pb, encoding, &dst, &taglen) < 0) {
> > +        av_log(s, AV_LOG_ERROR, "Error reading short description in COMM frame\n");
> > +        goto fail;
> > +    }
> > +    av_freep(&dst);
> 
> why is the short description discarded ?
> 

Should lang and short description be stored as comment_lang and
comment_short in the metadata dictionary ?

I thought that lang and short description (which does not seem to be used
in all the file i have) would not be interesting but It might be better to
not discard this stuff.


More information about the ffmpeg-devel mailing list