[Ffmpeg-cvslog] r6025 - trunk/libavformat/mpeg.c

michael subversion
Sat Aug 19 10:39:00 CEST 2006


Author: michael
Date: Sat Aug 19 10:39:00 2006
New Revision: 6025

Modified:
   trunk/libavformat/mpeg.c

Log:
fix probing of 02-Penguin.flac
= a single startcode should not override extension based detection


Modified: trunk/libavformat/mpeg.c
==============================================================================
--- trunk/libavformat/mpeg.c	(original)
+++ trunk/libavformat/mpeg.c	Sat Aug 19 10:39:00 2006
@@ -1265,6 +1265,7 @@
     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 @@
             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;
 }
 
 




More information about the ffmpeg-cvslog mailing list