Currently, only the mpegts path seeks back to the right position.
The mpegtsraw path needs this as well, so I'm moving it out of the
conditional.

Signed-off-by: Mike Williams <m...@mikebwilliams.com>
---
 libavformat/mpegts.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 4c25efe..7791060 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -1483,13 +1483,13 @@ static int mpegts_read_header(AVFormatContext *s,
         goto fail;
     ts->stream = s;
     ts->auto_guess = 0;
+        
+    if (avio_seek(pb, pos, SEEK_SET) < 0)
+        av_log(s, AV_LOG_ERROR, "Unable to seek back to the start\n");
 
     if (s->iformat == &ff_mpegts_demuxer) {
         /* normal demux */
-
         /* first do a scaning to get all the services */
-        if (avio_seek(pb, pos, SEEK_SET) < 0)
-            av_log(s, AV_LOG_ERROR, "Unable to seek back to the start\n");
 
         mpegts_open_section_filter(ts, SDT_PID, sdt_cb, ts, 1);
 
-- 
1.7.3.4

_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to