From 045b80e52df7ba9c97084c946b4929000d5f5bc7 Mon Sep 17 00:00:00 2001 From: Clément Bœsch Date: Fri, 21 Jan 2011 23:55:31 +0100 Subject: Move ID3v1 skip from decoder to demuxer Signed-off-by: Janne Grunau --- libavformat/mp3dec.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libavformat/mp3dec.c') 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; -- cgit v1.2.3