diff options
author | Alex Converse <alex.converse@gmail.com> | 2009-01-19 21:54:06 +0000 |
---|---|---|
committer | Alex Converse <alex.converse@gmail.com> | 2009-01-19 21:54:06 +0000 |
commit | ac3ef4a41b6de8bd0309fe166bb4c544f3d719be (patch) | |
tree | 709028defcbd2cfe5c1184fae3778d5a8c3512ae /libavformat/raw.c | |
parent | 2f642393381659f4a198d9c5a96896eebb23de18 (diff) | |
download | ffmpeg-ac3ef4a41b6de8bd0309fe166bb4c544f3d719be.tar.gz |
Fix probing of files with ID3v2 tags. Discussed at
http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/2009-January/059302.html
Originally committed as revision 16688 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/raw.c')
-rw-r--r-- | libavformat/raw.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/libavformat/raw.c b/libavformat/raw.c index 2ca011e509..fe6f6e40c3 100644 --- a/libavformat/raw.c +++ b/libavformat/raw.c @@ -26,6 +26,7 @@ #include "libavcodec/bytestream.h" #include "avformat.h" #include "raw.h" +#include "id3v2.h" /* simple formats */ #if CONFIG_FLAC_MUXER @@ -582,9 +583,15 @@ static int adts_aac_probe(AVProbeData *p) { int max_frames = 0, first_frames = 0; int fsize, frames; + uint8_t *buf0 = p->buf; uint8_t *buf2; - uint8_t *buf = p->buf; - uint8_t *end = buf + p->buf_size - 7; + uint8_t *buf; + uint8_t *end = buf0 + p->buf_size - 7; + + if (ff_id3v2_match(buf0)) { + buf0 += ff_id3v2_tag_len(buf0); + } + buf = buf0; for(; buf < end; buf= buf2+1) { buf2 = buf; @@ -599,7 +606,7 @@ static int adts_aac_probe(AVProbeData *p) buf2 += fsize; } max_frames = FFMAX(max_frames, frames); - if(buf == p->buf) + if(buf == buf0) first_frames= frames; } if (first_frames>=3) return AVPROBE_SCORE_MAX/2+1; |