hls: fix timebase
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 7 Mar 2013 12:42:12 +0000 (13:42 +0100)
committerCarl Eugen Hoyos <cehoyos@ag.or.at>
Thu, 7 Mar 2013 14:01:27 +0000 (15:01 +0100)
Fixes Ticket1733

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a12a618aa9c6d84ec3c01695fb5aec9796453a6d)

libavformat/hls.c

index 00c3cf0..065a759 100644 (file)
@@ -536,11 +536,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,