summaryrefslogtreecommitdiff
path: root/libavformat/id3v2.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavformat/id3v2.c')
-rw-r--r--libavformat/id3v2.c12
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;
+}