hls: Set stream offset before opening a chained demuxer
authorMartin Storsjö <martin@martin.st>
Sun, 28 Jul 2013 17:33:26 +0000 (20:33 +0300)
committerMartin Storsjö <martin@martin.st>
Mon, 29 Jul 2013 06:50:06 +0000 (09:50 +0300)
This makes sure we don't accidentally check discard flags
for the wrong stream.

Signed-off-by: Martin Storsjö <martin@martin.st>
libavformat/hls.c

index 213b717..86cf974 100644 (file)
@@ -523,10 +523,10 @@ static int hls_read_header(AVFormatContext *s)
             goto fail;
         }
         v->ctx->pb       = &v->pb;
+        v->stream_offset = stream_offset;
         ret = avformat_open_input(&v->ctx, v->segments[0]->url, in_fmt, NULL);
         if (ret < 0)
             goto fail;
-        v->stream_offset = stream_offset;
         snprintf(bitrate_str, sizeof(bitrate_str), "%d", v->bandwidth);
         /* Create new AVStreams for each stream in this variant */
         for (j = 0; j < v->ctx->nb_streams; j++) {