This is trial fix, i am far from being sure i did it the right way.
The problem i try to solve is that mpeg (mpegps) demuxer does not try to
discover any elementary streams at read_header().
The intention is to have VOB file elementary streams recognized without
avformat_find_stream_info(), which takes like 10x more time.
---8<---
---
libavformat/mpeg.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c
index a56f17a..1e4e614 100644
--- a/libavformat/mpeg.c
+++ b/libavformat/mpeg.c
@@ -109,6 +109,7 @@ static int mpegps_read_header(AVFormatContext *s)
MpegDemuxContext *m = s->priv_data;
const char *sofdec = "Sofdec";
int v, i = 0;
+ AVPacket pkt = { 0, };
m->header_state = 0xff;
s->ctx_flags |= AVFMTCTX_NOHEADER;
@@ -122,7 +123,9 @@ static int mpegps_read_header(AVFormatContext *s)
m->sofdec = (m->sofdec == 6) ? 1 : 0;
- /* no need to do more */
+ /* discover existing streams */
+ av_read_frame(s, &pkt);
+ avio_seek(s->pb, 0, SEEK_SET);
return 0;
}
--
1.7.8.6
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel