[Ffmpeg-cvslog] CVS: ffmpeg/libavformat mpeg.c,1.92,1.93

Michael Niedermayer CVS michael
Sat Feb 11 10:27:02 CET 2006


Update of /cvsroot/ffmpeg/ffmpeg/libavformat
In directory mail:/var2/tmp/cvs-serv32164

Modified Files:
	mpeg.c 
Log Message:
mpeg-ps probe 2nd try


Index: mpeg.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/mpeg.c,v
retrieving revision 1.92
retrieving revision 1.93
diff -u -d -r1.92 -r1.93
--- mpeg.c	8 Feb 2006 17:35:44 -0000	1.92
+++ mpeg.c	11 Feb 2006 09:27:00 -0000	1.93
@@ -1263,7 +1263,7 @@
 static int mpegps_probe(AVProbeData *p)
 {
     uint32_t code= -1;
-    int sys=0, pspack=0;
+    int sys=0, pspack=0, priv1=0, vid=0;
     int i;
 
     for(i=0; i<p->buf_size; i++){
@@ -1271,12 +1271,16 @@
         if ((code & 0xffffff00) == 0x100) {
             switch(code){
             case SYSTEM_HEADER_START_CODE:    sys++; break;
+            case         PRIVATE_STREAM_1:  priv1++; break;
             case          PACK_START_CODE: pspack++; break;
+            case       (VIDEO_ID + 0x100):    vid++; break;
             }
         }
     }
     if(sys && sys*9 <= pspack*10)
         return AVPROBE_SCORE_MAX/2+2; // +1 for .mpg
+    if((priv1 || vid) && (priv1+vid)*9 <= pspack*10)
+        return AVPROBE_SCORE_MAX/2+2; // +1 for .mpg
     return 0;
 }
 





More information about the ffmpeg-cvslog mailing list