Mercurial > libavformat.hg
changeset 1321:9eeb01383e30 libavformat
reduce scores if the mp3 frames dont start from the begin of the file (fixes flv deteted as mp3 issues)
author | michael |
---|---|
date | Wed, 20 Sep 2006 21:23:32 +0000 |
parents | 5cda22873c51 |
children | 95f56c7b24eb |
files | mp3.c |
diffstat | 1 files changed, 6 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/mp3.c Wed Sep 20 08:24:17 2006 +0000 +++ b/mp3.c Wed Sep 20 21:23:32 2006 +0000 @@ -244,7 +244,7 @@ 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 @@ 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; }