diff options
author | Alex Converse <alex.converse@gmail.com> | 2009-01-19 21:54:06 +0000 |
---|---|---|
committer | Alex Converse <alex.converse@gmail.com> | 2009-01-19 21:54:06 +0000 |
commit | ac3ef4a41b6de8bd0309fe166bb4c544f3d719be (patch) | |
tree | 709028defcbd2cfe5c1184fae3778d5a8c3512ae /libavformat/id3v2.c | |
parent | 2f642393381659f4a198d9c5a96896eebb23de18 (diff) | |
download | ffmpeg-ac3ef4a41b6de8bd0309fe166bb4c544f3d719be.tar.gz |
Fix probing of files with ID3v2 tags. Discussed at
http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/2009-January/059302.html
Originally committed as revision 16688 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/id3v2.c')
-rw-r--r-- | libavformat/id3v2.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libavformat/id3v2.c b/libavformat/id3v2.c index c27443b3c2..018fd51dc8 100644 --- a/libavformat/id3v2.c +++ b/libavformat/id3v2.c @@ -33,3 +33,15 @@ int ff_id3v2_match(const uint8_t *buf) (buf[8] & 0x80) == 0 && (buf[9] & 0x80) == 0; } + +int ff_id3v2_tag_len(const uint8_t * buf) +{ + int len = ((buf[6] & 0x7f) << 21) + + ((buf[7] & 0x7f) << 14) + + ((buf[8] & 0x7f) << 7) + + (buf[9] & 0x7f) + + ID3v2_HEADER_SIZE; + if (buf[5] & 0x10) + len += ID3v2_HEADER_SIZE; + return len; +} |