Skip to content
Snippets Groups Projects
Commit c11e33a3 authored by Martin Storsjö's avatar Martin Storsjö
Browse files

hls: Set stream offset before opening a chained demuxer


This makes sure we don't accidentally check discard flags
for the wrong stream.

Signed-off-by: default avatarMartin Storsjö <martin@martin.st>
parent cdd2d73d
No related branches found
No related tags found
No related merge requests found
...@@ -523,10 +523,10 @@ static int hls_read_header(AVFormatContext *s) ...@@ -523,10 +523,10 @@ static int hls_read_header(AVFormatContext *s)
goto fail; goto fail;
} }
v->ctx->pb = &v->pb; v->ctx->pb = &v->pb;
v->stream_offset = stream_offset;
ret = avformat_open_input(&v->ctx, v->segments[0]->url, in_fmt, NULL); ret = avformat_open_input(&v->ctx, v->segments[0]->url, in_fmt, NULL);
if (ret < 0) if (ret < 0)
goto fail; goto fail;
v->stream_offset = stream_offset;
snprintf(bitrate_str, sizeof(bitrate_str), "%d", v->bandwidth); snprintf(bitrate_str, sizeof(bitrate_str), "%d", v->bandwidth);
/* Create new AVStreams for each stream in this variant */ /* Create new AVStreams for each stream in this variant */
for (j = 0; j < v->ctx->nb_streams; j++) { for (j = 0; j < v->ctx->nb_streams; j++) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment