aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMåns Rullgård <mans@mansr.com>2006-06-28 21:40:08 +0000
committerMåns Rullgård <mans@mansr.com>2006-06-28 21:40:08 +0000
commit19e0e403f329baa8f1b31f47b089dba932ea31fe (patch)
tree2fa4bd2c27b5a8ae6c0427ccede2f84ec8ce57e8
parent54003e1a707dea428c4dc56d2fdda8180063b122 (diff)
downloadffmpeg-19e0e403f329baa8f1b31f47b089dba932ea31fe.tar.gz
detect MPEG PES streams as MPEG PS; the PS demuxer will cope
Originally committed as revision 5540 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavformat/mpeg.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c
index bf36222760..8c8a24284f 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, priv1=0, vid=0;
+ int sys=0, pspack=0, priv1=0, vid=0, audio=0;
int i;
for(i=0; i<p->buf_size; i++){
@@ -1274,6 +1274,7 @@ static int mpegps_probe(AVProbeData *p)
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 @@ static int mpegps_probe(AVProbeData *p)
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;
}