# HG changeset patch # User michael # Date 1139650020 0 # Node ID 53c4a89c1a82a429fbdbc9e59bfc72c26e2a073b # Parent 61959072be815156b4d7b398352b334cc5215877 mpeg-ps probe 2nd try diff -r 61959072be81 -r 53c4a89c1a82 mpeg.c --- a/mpeg.c Fri Feb 10 01:24:32 2006 +0000 +++ b/mpeg.c Sat Feb 11 09:27:00 2006 +0000 @@ -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; ibuf_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; }