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

Clément Bœsch ubitux at gmail.com
Sun Jul 1 21:11:37 CEST 2012


On Sun, Jul 01, 2012 at 08:32:29PM +0200, Matthieu Bouron wrote:
> 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 ?
> 

"language" and "description" looks appropriate to me, they are already
used elsewhere in the codebase.

[...]

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120701/e4fac922/attachment.asc>


More information about the ffmpeg-devel mailing list