Commit 62171ab1 authored by mru's avatar mru

attempt to detect Chinese AVS video


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@5604 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 788f500d
...@@ -1605,8 +1605,15 @@ static int mpegps_read_packet(AVFormatContext *s, ...@@ -1605,8 +1605,15 @@ static int mpegps_read_packet(AVFormatContext *s,
goto skip; goto skip;
} }
} else if (startcode >= 0x1e0 && startcode <= 0x1ef) { } else if (startcode >= 0x1e0 && startcode <= 0x1ef) {
type = CODEC_TYPE_VIDEO; 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; codec_id = CODEC_ID_MPEG2VIDEO;
type = CODEC_TYPE_VIDEO;
} else if (startcode >= 0x1c0 && startcode <= 0x1df) { } else if (startcode >= 0x1c0 && startcode <= 0x1df) {
type = CODEC_TYPE_AUDIO; type = CODEC_TYPE_AUDIO;
codec_id = CODEC_ID_MP2; codec_id = CODEC_ID_MP2;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment