diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-09-07 19:18:21 +0200 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2014-11-01 16:12:52 +0100 |
commit | c9659dfd294211e3b95d6a5115466fde4acdd51a (patch) | |
tree | 19491b6a83b3a334f6b1c3b355b2dca015073fa1 | |
parent | 41ee9a44955b65c3cfd188ebabe757da74bf0fc3 (diff) | |
download | ffmpeg-c9659dfd294211e3b95d6a5115466fde4acdd51a.tar.gz |
avformat/mpeg: increase score for short mpeg-ps by 1
Fixes Ticket 3855
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 5109ce2017c15202275b33bce58ec9d88044eeb5)
Conflicts:
libavformat/mpeg.c
-rw-r--r-- | libavformat/mpeg.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c index 1777283939..a9016b9a7b 100644 --- a/libavformat/mpeg.c +++ b/libavformat/mpeg.c @@ -91,16 +91,20 @@ static int mpegps_probe(AVProbeData *p) if(vid+audio > invalid+1) /* invalid VDR files nd short PES streams */ score = AVPROBE_SCORE_EXTENSION / 2; - if(sys>invalid && sys*9 <= pspack*10) - return (audio > 12 || vid > 3 || pspack > 2) ? AVPROBE_SCORE_EXTENSION + 2 : AVPROBE_SCORE_EXTENSION / 2; // 1 more than .mpg - if(pspack > invalid && (priv1+vid+audio)*10 >= pspack*9) - return pspack > 2 ? AVPROBE_SCORE_EXTENSION + 2 : AVPROBE_SCORE_EXTENSION / 2; // 1 more than .mpg - if((!!vid ^ !!audio) && (audio > 4 || vid > 1) && !sys && !pspack && p->buf_size>2048 && vid + audio > invalid) /* PES stream */ - return (audio > 12 || vid > 3 + 2*invalid) ? AVPROBE_SCORE_EXTENSION + 2 : AVPROBE_SCORE_EXTENSION / 2; - - //02-Penguin.flac has sys:0 priv1:0 pspack:0 vid:0 audio:1 - //mp3_misidentified_2.mp3 has sys:0 priv1:0 pspack:0 vid:0 audio:6 - //Have\ Yourself\ a\ Merry\ Little\ Christmas.mp3 0 0 0 5 0 1 len:21618 + if (sys > invalid && sys * 9 <= pspack * 10) + return (audio > 12 || vid > 3 || pspack > 2) ? AVPROBE_SCORE_EXTENSION + 2 + : AVPROBE_SCORE_EXTENSION / 2 + 1; // 1 more than .mpg + if (pspack > invalid && (priv1 + vid + audio) * 10 >= pspack * 9) + return pspack > 2 ? AVPROBE_SCORE_EXTENSION + 2 + : AVPROBE_SCORE_EXTENSION / 2; // 1 more than .mpg + if ((!!vid ^ !!audio) && (audio > 4 || vid > 1) && !sys && + !pspack && p->buf_size > 2048 && vid + audio > invalid) /* PES stream */ + return (audio > 12 || vid > 3 + 2 * invalid) ? AVPROBE_SCORE_EXTENSION + 2 + : AVPROBE_SCORE_EXTENSION / 2; + + // 02-Penguin.flac has sys:0 priv1:0 pspack:0 vid:0 audio:1 + // mp3_misidentified_2.mp3 has sys:0 priv1:0 pspack:0 vid:0 audio:6 + // Have\ Yourself\ a\ Merry\ Little\ Christmas.mp3 0 0 0 5 0 1 len:21618 return score; } |