[FFmpeg-devel] [PATCH 1/3] lavf/id3v2 read COMM tag
Michael Niedermayer
michaelni at gmx.at
Sun Jul 1 21:07:09 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 ?
i dont know but i think both should be exported someow
>
> 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.
if they are never set in the files you have it might make sense to
print a note that we want a sample for files that do have them set
see av_log_ask_for_sample()
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
I do not agree with what you have to say, but I'll defend to the death your
right to say it. -- Voltaire
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120701/91d4b3c5/attachment.asc>
More information about the ffmpeg-devel
mailing list