Commit 5e3900c7 authored by Michael Niedermayer's avatar Michael Niedermayer

hls: Initialize stream_offset before find_stream_info.

find stream info causes reads that may use the offset in their callback
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent cc913f74
......@@ -527,11 +527,11 @@ static int hls_read_header(AVFormatContext *s)
if (ret < 0)
goto fail;
v->stream_offset = stream_offset;
v->ctx->ctx_flags &= ~AVFMTCTX_NOHEADER;
ret = avformat_find_stream_info(v->ctx, 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++) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment