Mercurial > libavformat.hg
diff id3v2.c @ 4254:d05b13327b07 libavformat
Fix probing of files with ID3v2 tags. Discussed at
http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/2009-January/059302.html
author | alexc |
---|---|
date | Mon, 19 Jan 2009 21:54:06 +0000 |
parents | 55f448c99135 |
children | eb6dd7717805 |
line wrap: on
line diff
--- a/id3v2.c Mon Jan 19 17:01:22 2009 +0000 +++ b/id3v2.c Mon Jan 19 21:54:06 2009 +0000 @@ -33,3 +33,15 @@ (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; +}