[FFmpeg-cvslog] avformat/mpeg: increase score for short mpeg-ps by 1
Michael Niedermayer
git at videolan.org
Sat Nov 1 16:13:03 CET 2014
ffmpeg | branch: release/2.2 | Michael Niedermayer <michaelni at gmx.at> | Sun Sep 7 19:18:21 2014 +0200| [c9659dfd294211e3b95d6a5115466fde4acdd51a] | committer: Carl Eugen Hoyos
avformat/mpeg: increase score for short mpeg-ps by 1
Fixes Ticket 3855
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 5109ce2017c15202275b33bce58ec9d88044eeb5)
Conflicts:
libavformat/mpeg.c
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c9659dfd294211e3b95d6a5115466fde4acdd51a
---
libavformat/mpeg.c | 24 ++++++++++++++----------
1 file changed, 14 insertions(+), 10 deletions(-)
diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c
index 1777283..a9016b9 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;
}
More information about the ffmpeg-cvslog
mailing list