hls: Initialize stream_offset before find_stream_info.

find stream info causes reads that may use the offset in their callback

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-08-13 20:37:52 +02:00
parent cc913f7490
commit 5e3900c7a5
1 changed files with 1 additions and 1 deletions

View File

@ -527,11 +527,11 @@ static int hls_read_header(AVFormatContext *s)
if (ret < 0) if (ret < 0)
goto fail; goto fail;
v->stream_offset = stream_offset;
v->ctx->ctx_flags &= ~AVFMTCTX_NOHEADER; v->ctx->ctx_flags &= ~AVFMTCTX_NOHEADER;
ret = avformat_find_stream_info(v->ctx, NULL); ret = avformat_find_stream_info(v->ctx, 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++) {