summaryrefslogtreecommitdiff
path: root/libavformat/mpeg.c
diff options
context:
space:
mode:
authorMåns Rullgård <mans@mansr.com>2006-07-03 21:40:01 +0000
committerMåns Rullgård <mans@mansr.com>2006-07-03 21:40:01 +0000
commit83d07313647bc2bf98030825a44532205ca84936 (patch)
treeecbd136451852d53817b6c3527e65bd1787df77f /libavformat/mpeg.c
parentad78c0f3f1456a88392acbc859fc66d38ebed499 (diff)
attempt to detect Chinese AVS video
Originally committed as revision 5604 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/mpeg.c')
-rw-r--r--libavformat/mpeg.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c
index eca8bff511..e5f76bdc0d 100644
--- a/libavformat/mpeg.c
+++ b/libavformat/mpeg.c
@@ -1605,8 +1605,15 @@ static int mpegps_read_packet(AVFormatContext *s,
goto skip;
}
} else if (startcode >= 0x1e0 && startcode <= 0x1ef) {
+ static const unsigned char avs_seqh[4] = { 0, 0, 1, 0xb0 };
+ unsigned char buf[8];
+ get_buffer(&s->pb, buf, 8);
+ url_fseek(&s->pb, -8, SEEK_CUR);
+ if(!memcmp(buf, avs_seqh, 4) && (buf[6] != 0 || buf[7] != 1))
+ codec_id = CODEC_ID_CAVS;
+ else
+ codec_id = CODEC_ID_MPEG2VIDEO;
type = CODEC_TYPE_VIDEO;
- codec_id = CODEC_ID_MPEG2VIDEO;
} else if (startcode >= 0x1c0 && startcode <= 0x1df) {
type = CODEC_TYPE_AUDIO;
codec_id = CODEC_ID_MP2;