diff options
author | Clément Bœsch <ubitux@gmail.com> | 2011-01-21 23:55:31 +0100 |
---|---|---|
committer | Janne Grunau <janne-ffmpeg@jannau.net> | 2011-01-22 01:31:57 +0100 |
commit | 045b80e52df7ba9c97084c946b4929000d5f5bc7 (patch) | |
tree | 75178e733322b679d6715a30432f026ef902c064 | |
parent | f4b1e21a6304cda58ac36401d8f8dec7ff61d056 (diff) | |
download | ffmpeg-045b80e52df7ba9c97084c946b4929000d5f5bc7.tar.gz |
Move ID3v1 skip from decoder to demuxer
Signed-off-by: Janne Grunau <janne-ffmpeg@jannau.net>
-rw-r--r-- | libavcodec/mpegaudiodec.c | 8 | ||||
-rw-r--r-- | libavformat/mp3dec.c | 5 |
2 files changed, 5 insertions, 8 deletions
diff --git a/libavcodec/mpegaudiodec.c b/libavcodec/mpegaudiodec.c index 76fdffbafe..769be89913 100644 --- a/libavcodec/mpegaudiodec.c +++ b/libavcodec/mpegaudiodec.c @@ -27,7 +27,6 @@ #include "avcodec.h" #include "get_bits.h" #include "dsputil.h" -#include "libavformat/id3v1.h" /* * TODO: @@ -2044,13 +2043,6 @@ static int decode_frame(AVCodecContext * avctx, header = AV_RB32(buf); if(ff_mpa_check_header(header) < 0){ - - if (buf_size == ID3v1_TAG_SIZE - && buf[0] == 'T' && buf[1] == 'A' && buf[2] == 'G') { - *data_size = 0; - return ID3v1_TAG_SIZE; - } - av_log(avctx, AV_LOG_ERROR, "Header missing\n"); return -1; } 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; |