[FFmpeg-cvslog] hls: Initialize stream_offset before find_stream_info.

Michael Niedermayer git at videolan.org
Mon Aug 13 22:54:35 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Mon Aug 13 20:37:52 2012 +0200| [5e3900c7a53cbe3a376ff06c52e54108e94e6427] | committer: 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: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5e3900c7a53cbe3a376ff06c52e54108e94e6427
---

 libavformat/hls.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/hls.c b/libavformat/hls.c
index 98d4151..7add01f 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -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++) {



More information about the ffmpeg-cvslog mailing list