]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/blobdiff - libavformat/id3v2.c
Fix probing of files with ID3v2 tags. Discussed at http://lists.mplayerhq.hu/pipermai...
[frescor/ffmpeg.git] / libavformat / id3v2.c
index c27443b3c2ed1f3fce2bd97a9674f3f4bf36ebca..018fd51dc822ace3253d525467c1a55c60f0fde1 100644 (file)
@@ -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;
+}