diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2006-08-19 08:39:00 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2006-08-19 08:39:00 +0000 |
commit | a1c69e0b5097be8fa76c3882f535c6600b0e56b6 (patch) | |
tree | 291627ca0d55dea035032a73a271214001793a10 /libavformat/mpeg.c | |
parent | 652c59b967d7bbcc3322ba4f5c8c0bfe02794a25 (diff) | |
download | ffmpeg-a1c69e0b5097be8fa76c3882f535c6600b0e56b6.tar.gz |
fix probing of 02-Penguin.flac
= a single startcode should not override extension based detection
Originally committed as revision 6025 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/mpeg.c')
-rw-r--r-- | libavformat/mpeg.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c index d3dd0e02cf..1b77b64afa 100644 --- a/libavformat/mpeg.c +++ b/libavformat/mpeg.c @@ -1265,6 +1265,7 @@ static int mpegps_probe(AVProbeData *p) uint32_t code= -1; int sys=0, pspack=0, priv1=0, vid=0, audio=0; int i; + int score=0; for(i=0; i<p->buf_size; i++){ code = (code<<8) + p->buf[i]; @@ -1276,15 +1277,20 @@ static int mpegps_probe(AVProbeData *p) else if((code & 0xe0) == AUDIO_ID) audio++; } } + + if(vid || audio) /* invalid VDR files nd short PES streams */ + score= AVPROBE_SCORE_MAX/4; + +//av_log(NULL, AV_LOG_ERROR, "%d %d %d %d %d\n", sys, priv1, pspack,vid, audio); if(sys && sys*9 <= pspack*10) return AVPROBE_SCORE_MAX/2+2; // +1 for .mpg if((priv1 || vid || audio) && (priv1+vid+audio)*9 <= pspack*10) return AVPROBE_SCORE_MAX/2+2; // +1 for .mpg - if((!!vid ^ !!audio) && !sys && !pspack) /* PES stream */ - return AVPROBE_SCORE_MAX/2+2; - if(vid || audio) /* invalid VDR files */ + if((!!vid ^ !!audio) && (audio+vid > 1) && !sys && !pspack) /* PES stream */ return AVPROBE_SCORE_MAX/2+2; - return 0; + + //02-Penguin.flac has sys:0 priv1:0 pspack:0 vid:0 audio:1 + return score; } |