hls: Call avformat_find_stream_info() on the chained demuxers
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 25 Jul 2012 15:40:33 +0000 (17:40 +0200)
committerMartin Storsjö <martin@martin.st>
Tue, 30 Jul 2013 09:31:08 +0000 (12:31 +0300)
This allows the chained demuxer (or more precisely, the lavf
utility code) to better fill in timestamps on packets from
these, especially for cases where one stream is a raw ADTS
stream.

Signed-off-by: Martin Storsjö <martin@martin.st>
libavformat/hls.c

index 9aef5e0..ea16f8a 100644 (file)
@@ -529,6 +529,11 @@ static int hls_read_header(AVFormatContext *s)
         ret = avformat_open_input(&v->ctx, v->segments[0]->url, in_fmt, NULL);
         if (ret < 0)
             goto fail;
+
+        v->ctx->ctx_flags &= ~AVFMTCTX_NOHEADER;
+        ret = avformat_find_stream_info(v->ctx, NULL);
+        if (ret < 0)
+            goto fail;
         snprintf(bitrate_str, sizeof(bitrate_str), "%d", v->bandwidth);
 
         program = av_new_program(s, i);