diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2006-09-20 21:23:32 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2006-09-20 21:23:32 +0000 |
commit | 22668218f920981fc88ff4175ee6af8b895a201b (patch) | |
tree | 65a423c071e4419f89ca424a5492c3de46e65c78 /libavformat/mp3.c | |
parent | c3e462a8ca8127acacd0848c2e6ea4a45e628cd7 (diff) | |
download | ffmpeg-streaming-22668218f920981fc88ff4175ee6af8b895a201b.zip ffmpeg-streaming-22668218f920981fc88ff4175ee6af8b895a201b.tar.gz |
reduce scores if the mp3 frames dont start from the begin of the file (fixes flv deteted as mp3 issues)
Originally committed as revision 6304 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/mp3.c')
-rw-r--r-- | libavformat/mp3.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libavformat/mp3.c b/libavformat/mp3.c index 04ff0b2..f7ba7b6 100644 --- a/libavformat/mp3.c +++ b/libavformat/mp3.c @@ -244,7 +244,7 @@ static void id3_create_tag(AVFormatContext *s, uint8_t *buf) static int mp3_read_probe(AVProbeData *p) { - int max_frames; + int max_frames, first_frames; int fsize, frames; uint32_t header; uint8_t *buf, *buf2, *end; @@ -271,10 +271,12 @@ static int mp3_read_probe(AVProbeData *p) buf2 += fsize; } max_frames = FFMAX(max_frames, frames); + if(buf == p->buf) + first_frames= frames; } - if (max_frames>=3) return AVPROBE_SCORE_MAX/2+1; - else if(max_frames==2) return AVPROBE_SCORE_MAX/4; - else if(max_frames==1) return 1; + if (first_frames>=3) return AVPROBE_SCORE_MAX/2+1; + else if(max_frames>=3) return AVPROBE_SCORE_MAX/4; + else if(max_frames>=1) return 1; else return 0; } |