diff options
author | Fabrice Bellard <fabrice@bellard.org> | 2002-10-04 15:46:59 +0000 |
---|---|---|
committer | Fabrice Bellard <fabrice@bellard.org> | 2002-10-04 15:46:59 +0000 |
commit | 1e5c667c91885a75169b390d2b3d632fcfc1ac1f (patch) | |
tree | 25e2a2aa6a747e92ff78f295cff69e28732fb46a /libav/mpeg.c | |
parent | 7be166e4ea8690efe70adc159d2964b88b5f64cd (diff) | |
download | ffmpeg-1e5c667c91885a75169b390d2b3d632fcfc1ac1f.tar.gz |
fixed MPEG2 pts parsing - ignore unknown stream type
Originally committed as revision 1001 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libav/mpeg.c')
-rw-r--r-- | libav/mpeg.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libav/mpeg.c b/libav/mpeg.c index f6ceaeedbe..a5aa84b1d8 100644 --- a/libav/mpeg.c +++ b/libav/mpeg.c @@ -555,7 +555,7 @@ static int mpegps_read_packet(AVFormatContext *s, len -= 2; if (header_len > len) goto redo; - if ((flags & 0xc0) == 0x40) { + if ((flags & 0xc0) == 0x80) { pts = get_pts(&s->pb, -1); dts = pts; header_len -= 5; @@ -590,10 +590,6 @@ static int mpegps_read_packet(AVFormatContext *s, if (st->id == startcode) goto found; } - /* no stream found: add a new stream */ - st = av_new_stream(s, startcode); - if (!st) - goto skip; if (startcode >= 0x1e0 && startcode <= 0x1ef) { type = CODEC_TYPE_VIDEO; codec_id = CODEC_ID_MPEG1VIDEO; @@ -609,6 +605,10 @@ static int mpegps_read_packet(AVFormatContext *s, url_fskip(&s->pb, len); 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_id = codec_id; found: |