[FFmpeg-devel] skip multiple id3v2 headers

David Byron dbyron
Tue Sep 7 21:59:23 CEST 2010


> >      ff_id3v2_read(s, ID3v2_DEFAULT_MAGIC);
> > +
> > +    /* skip any extra id3v2 frames that may be present since
> > +       they may contain data that looks like an mpeg frame */
> > +    while (ff_id3v2_skip(s, ID3v2_DEFAULT_MAGIC))
> > +        av_log(s,AV_LOG_VERBOSE,"skipping additional id3v2 tag in
\"%s\"\n",
> > +               s->filename);
> > +
> 
> why doesnt ff_id3v2_read() does this ?

ff_id3v2_read calls ff_id3v2_parse.  I think it's more correct to ignore
additional id3v2 frames which is why I wrote ff_id3v2_skip.

I see that ff_id3v2_read is called from other places, so I can put the loop
calling ff_id3v2_skip inside ff_id3v2_read if that's what you had in mind.

> also we need a mp3 file that requires this change (not
> sure if you provided one and i missed it)

Here's one, with the test program I'm using.

Here's the output before the change:

$ ./iterate_frames two_id3v2_with_fake_mpeg_small.mp3
Format detected only with low score of 24, misdetection possible!
"two_id3v2_with_fake_mpeg_small.mp3": frame 0: size 6906 byte(s)
"two_id3v2_with_fake_mpeg_small.mp3": frame 1: size 511 byte(s)
"two_id3v2_with_fake_mpeg_small.mp3": 2 frame(s), 7417 byte(s)

and afterwards:

$ ./iterate_frames two_id3v2_with_fake_mpeg_small.mp3
Format detected only with low score of 24, misdetection possible!
[mp3 @ 0x23da070] skipping additional id3v2 tag in
"two_id3v2_with_fake_mpeg_small.mp3"
"two_id3v2_with_fake_mpeg_small.mp3": frame 0: size 627 byte(s)
"two_id3v2_with_fake_mpeg_small.mp3": 1 frame(s), 627 byte(s)

Thanks.

-DB
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: iterate_frames.c
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100907/6675b294/attachment.txt>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: two_id3v2_with_fake_mpeg_small.mp3
Type: audio/mpeg
Size: 14207 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100907/6675b294/attachment.mp3>



More information about the ffmpeg-devel mailing list