[06/10] hls: Set stream offset before opening a chained demuxer

Message ID 1375038091-92151-6-git-send-email-martin@martin.st
State Committed
Commit c11e33a3d9665dd1fc5dbdecdd03a4860ac6a622
Headers show

Commit Message

Martin Storsjö July 28, 2013, 7:01 p.m.
This makes sure we don't accidentally check discard flags
for the wrong stream.
---
 libavformat/hls.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Luca Barbato July 28, 2013, 8:09 p.m. | #1
On 28/07/13 21:01, Martin Storsjö wrote:
> This makes sure we don't accidentally check discard flags
> for the wrong stream.
> ---
>  libavformat/hls.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

Seems fine.

lu

Patch

diff --git a/libavformat/hls.c b/libavformat/hls.c
index 5cb00b7..60a1532 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -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++) {