mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
fixed MPEG2 pts parsing - ignore unknown stream type
Originally committed as revision 1001 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
7be166e4ea
commit
1e5c667c91
10
libav/mpeg.c
10
libav/mpeg.c
@ -555,7 +555,7 @@ static int mpegps_read_packet(AVFormatContext *s,
|
|||||||
len -= 2;
|
len -= 2;
|
||||||
if (header_len > len)
|
if (header_len > len)
|
||||||
goto redo;
|
goto redo;
|
||||||
if ((flags & 0xc0) == 0x40) {
|
if ((flags & 0xc0) == 0x80) {
|
||||||
pts = get_pts(&s->pb, -1);
|
pts = get_pts(&s->pb, -1);
|
||||||
dts = pts;
|
dts = pts;
|
||||||
header_len -= 5;
|
header_len -= 5;
|
||||||
@ -590,10 +590,6 @@ static int mpegps_read_packet(AVFormatContext *s,
|
|||||||
if (st->id == startcode)
|
if (st->id == startcode)
|
||||||
goto found;
|
goto found;
|
||||||
}
|
}
|
||||||
/* no stream found: add a new stream */
|
|
||||||
st = av_new_stream(s, startcode);
|
|
||||||
if (!st)
|
|
||||||
goto skip;
|
|
||||||
if (startcode >= 0x1e0 && startcode <= 0x1ef) {
|
if (startcode >= 0x1e0 && startcode <= 0x1ef) {
|
||||||
type = CODEC_TYPE_VIDEO;
|
type = CODEC_TYPE_VIDEO;
|
||||||
codec_id = CODEC_ID_MPEG1VIDEO;
|
codec_id = CODEC_ID_MPEG1VIDEO;
|
||||||
@ -609,6 +605,10 @@ static int mpegps_read_packet(AVFormatContext *s,
|
|||||||
url_fskip(&s->pb, len);
|
url_fskip(&s->pb, len);
|
||||||
goto redo;
|
goto redo;
|
||||||
}
|
}
|
||||||
|
/* no stream found: add a new stream */
|
||||||
|
st = av_new_stream(s, startcode);
|
||||||
|
if (!st)
|
||||||
|
goto skip;
|
||||||
st->codec.codec_type = type;
|
st->codec.codec_type = type;
|
||||||
st->codec.codec_id = codec_id;
|
st->codec.codec_id = codec_id;
|
||||||
found:
|
found:
|
||||||
|
Loading…
Reference in New Issue
Block a user