Commit b2f230e2 authored by Arne de Bruijn's avatar Arne de Bruijn Committed by Michael Niedermayer

mpegpsdec: fix reading first mpegps packet

parent 140dbcff
...@@ -106,6 +106,7 @@ static int mpegps_read_header(AVFormatContext *s, ...@@ -106,6 +106,7 @@ static int mpegps_read_header(AVFormatContext *s,
MpegDemuxContext *m = s->priv_data; MpegDemuxContext *m = s->priv_data;
const char *sofdec = "Sofdec"; const char *sofdec = "Sofdec";
int v, i = 0; int v, i = 0;
int64_t last_pos = avio_tell(s->pb);
m->header_state = 0xff; m->header_state = 0xff;
s->ctx_flags |= AVFMTCTX_NOHEADER; s->ctx_flags |= AVFMTCTX_NOHEADER;
...@@ -119,6 +120,9 @@ static int mpegps_read_header(AVFormatContext *s, ...@@ -119,6 +120,9 @@ static int mpegps_read_header(AVFormatContext *s,
m->sofdec = (m->sofdec == 6) ? 1 : 0; m->sofdec = (m->sofdec == 6) ? 1 : 0;
if (!m->sofdec)
avio_seek(s->pb, last_pos, SEEK_SET);
/* no need to do more */ /* no need to do more */
return 0; return 0;
} }
......
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