summaryrefslogtreecommitdiff
path: root/libavformat/mpeg.c
diff options
context:
space:
mode:
authorArne de Bruijn <mail@arnedebruijn.nl>2011-09-17 14:59:00 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-09-18 01:57:56 +0200
commitb2f230e23dd61112ac090b0c059d87b5f6bcb307 (patch)
tree2aa3e39b161362b05f5fd6cc416d5a4e81241f18 /libavformat/mpeg.c
parent140dbcff357351570426efd0e0bc00e380f5436e (diff)
mpegpsdec: fix reading first mpegps packet
Diffstat (limited to 'libavformat/mpeg.c')
-rw-r--r--libavformat/mpeg.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c
index dc5d264b68..c58e07268a 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;
}