Browse Source

mpegpsdec: fix reading first mpegps packet

tags/n0.9
Arne de Bruijn Michael Niedermayer 14 years ago
parent
commit
b2f230e23d
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      libavformat/mpeg.c

+ 4
- 0
libavformat/mpeg.c View File

@@ -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;
}


Loading…
Cancel
Save