diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2006-02-11 09:27:00 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2006-02-11 09:27:00 +0000 |
commit | 0b2bb3543fabd38d6c98d5678dc4098ec5c37dec (patch) | |
tree | b6eaa42697501e57a7731bb485599196b7296814 /libavformat/mpeg.c | |
parent | 5c4b1b253848eaf098301c67ba426d326579bb68 (diff) | |
download | ffmpeg-0b2bb3543fabd38d6c98d5678dc4098ec5c37dec.tar.gz |
mpeg-ps probe 2nd try
Originally committed as revision 4974 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/mpeg.c')
-rw-r--r-- | libavformat/mpeg.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c index b45dca0f6a..2474a37741 100644 --- a/libavformat/mpeg.c +++ b/libavformat/mpeg.c @@ -1263,7 +1263,7 @@ static int mpeg_mux_end(AVFormatContext *ctx) 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 @@ static int mpegps_probe(AVProbeData *p) 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; } |