[FFmpeg-devel] [PATCH] MPEG-PES avoid MP3 misdetection
Reimar Döffinger
Reimar.Doeffinger
Sun Sep 13 23:57:12 CEST 2009
Hello,
this is one suggestion for fixing issue1383.
There are no really specific reasons for the values chosen, except that
the lower score now matches the ones for the "unclear" mp3 detection,
so we should continue probing if we are not yet sure if we have mp3 or PES.
Index: libavformat/mpeg.c
===================================================================
--- libavformat/mpeg.c (revision 19824)
+++ libavformat/mpeg.c (working copy)
@@ -82,9 +82,10 @@
if(priv1 + vid + audio > invalid && (priv1+vid+audio)*9 <= pspack*10)
return AVPROBE_SCORE_MAX/2+2; // +1 for .mpg
if((!!vid ^ !!audio) && (audio > 4 || vid > 1) && !sys && !pspack && p->buf_size>2048) /* PES stream */
- return AVPROBE_SCORE_MAX/2+2;
+ return (audio > 12 || vid > 3) ? AVPROBE_SCORE_MAX/2+2 : AVPROBE_SCORE_MAX/4;
//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
return score;
}
More information about the ffmpeg-devel
mailing list