summaryrefslogtreecommitdiff
path: root/libavformat/hls.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-03-07 13:42:12 +0100
committerMartin Storsjö <martin@martin.st>2013-07-29 09:50:03 +0300
commit82bf8c878345b6178ba32c7270a86670a92a72c2 (patch)
tree1e142480a0e15564eae3f76a2c003e15e23e3958 /libavformat/hls.c
parenteb33ba04e03d9f36e23fffd442510c824be709c3 (diff)
hls: Copy the time base from the chained demuxer
When a variant stream isn't mpegts but e.g. raw adts, the default time base (90k) isn't correct. Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavformat/hls.c')
-rw-r--r--libavformat/hls.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/hls.c b/libavformat/hls.c
index 464faee793..b9b1feaf3d 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -530,11 +530,13 @@ static int hls_read_header(AVFormatContext *s)
/* Create new AVStreams for each stream in this variant */
for (j = 0; j < v->ctx->nb_streams; j++) {
AVStream *st = avformat_new_stream(s, NULL);
+ AVStream *ist = v->ctx->streams[j];
if (!st) {
ret = AVERROR(ENOMEM);
goto fail;
}
st->id = i;
+ avpriv_set_pts_info(st, ist->pts_wrap_bits, ist->time_base.num, ist->time_base.den);
avcodec_copy_context(st->codec, v->ctx->streams[j]->codec);
if (v->bandwidth)
av_dict_set(&st->metadata, "variant_bitrate", bitrate_str,