summaryrefslogtreecommitdiff
path: root/libavformat/mp3dec.c
diff options
context:
space:
mode:
authorClément Bœsch <ubitux@gmail.com>2011-01-21 23:55:31 +0100
committerMichael Niedermayer <michaelni@gmx.at>2011-01-23 19:32:07 +0100
commit204a18151c7c6deb65fcdce5273f23813df3dc83 (patch)
treef893acc068e9990010efeef8acd8539e02effdad /libavformat/mp3dec.c
parent05238927b79c00c972c968599d8cfddb676e935d (diff)
Move ID3v1 skip from decoder to demuxer
Signed-off-by: Janne Grunau <janne-ffmpeg@jannau.net> (cherry picked from commit 045b80e52df7ba9c97084c946b4929000d5f5bc7)
Diffstat (limited to 'libavformat/mp3dec.c')
-rw-r--r--libavformat/mp3dec.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/mp3dec.c b/libavformat/mp3dec.c
index ab6aabe0b5..c06969b058 100644
--- a/libavformat/mp3dec.c
+++ b/libavformat/mp3dec.c
@@ -174,6 +174,11 @@ static int mp3_read_packet(AVFormatContext *s, AVPacket *pkt)
if (ret <= 0) {
return AVERROR(EIO);
}
+
+ if (ret > ID3v1_TAG_SIZE &&
+ memcmp(&pkt->data[ret - ID3v1_TAG_SIZE], "TAG", 3) == 0)
+ ret -= ID3v1_TAG_SIZE;
+
/* note: we need to modify the packet size here to handle the last
packet */
pkt->size = ret;