# HG changeset patch # User mru # Date 1151530808 0 # Node ID 36ce24677f96764e5bb33d9826c237861e2da03b # Parent 246df8e6aab78f0cb7126295b1346ad50e5ddb42 detect MPEG PES streams as MPEG PS; the PS demuxer will cope diff -r 246df8e6aab7 -r 36ce24677f96 mpeg.c --- a/mpeg.c Wed Jun 28 12:18:22 2006 +0000 +++ b/mpeg.c Wed Jun 28 21:40:08 2006 +0000 @@ -1263,7 +1263,7 @@ static int mpegps_probe(AVProbeData *p) { uint32_t code= -1; - int sys=0, pspack=0, priv1=0, vid=0; + int sys=0, pspack=0, priv1=0, vid=0, audio=0; int i; for(i=0; ibuf_size; i++){ @@ -1274,6 +1274,7 @@ case PRIVATE_STREAM_1: priv1++; break; case PACK_START_CODE: pspack++; break; case (VIDEO_ID + 0x100): vid++; break; + case (AUDIO_ID + 0x100): audio++; break; } } } @@ -1281,6 +1282,8 @@ 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 + if((!!vid ^ !!audio) && !sys && !pspack) /* PES stream */ + return AVPROBE_SCORE_MAX/2; return 0; }