diff options
author | Arne de Bruijn <mail@arnedebruijn.nl> | 2011-09-17 14:59:00 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-09-21 20:56:53 +0200 |
commit | 89bd2307f52c3eceb50df64cd7a62c35fe9ee189 (patch) | |
tree | 15b51af7adafa25fc96e82bfc4ed15e1586da32e /libavformat | |
parent | 60a1384013071e4549e48459d484a7b72aeb6ebc (diff) | |
download | ffmpeg-89bd2307f52c3eceb50df64cd7a62c35fe9ee189.tar.gz |
mpegpsdec: fix reading first mpegps packet
(cherry picked from commit b2f230e23dd61112ac090b0c059d87b5f6bcb307)
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/mpeg.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c index 1bc4480cd8..3166b42172 100644 --- a/libavformat/mpeg.c +++ b/libavformat/mpeg.c @@ -106,6 +106,7 @@ static int mpegps_read_header(AVFormatContext *s, MpegDemuxContext *m = s->priv_data; const char *sofdec = "Sofdec"; int v, i = 0; + int64_t last_pos = avio_tell(s->pb); m->header_state = 0xff; s->ctx_flags |= AVFMTCTX_NOHEADER; @@ -119,6 +120,9 @@ static int mpegps_read_header(AVFormatContext *s, m->sofdec = (m->sofdec == 6) ? 1 : 0; + if (!m->sofdec) + avio_seek(s->pb, last_pos, SEEK_SET); + /* no need to do more */ return 0; } |