From b1a0fccd023d9261274a92ec9482da03c4aa82fa Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sun, 28 Sep 2014 22:27:33 +0200 Subject: [PATCH] avformat/hlsenc: export inner muxer timebase Fixes "Non-monotonous DTS in output stream 0:0" Fies Ticket 3797 Signed-off-by: Michael Niedermayer --- libavformat/hlsenc.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index c89813e5e2..b984e031ef 100644 --- a/libavformat/hlsenc.c +++ b/libavformat/hlsenc.c @@ -22,6 +22,7 @@ #include #include +#include "libavutil/avassert.h" #include "libavutil/mathematics.h" #include "libavutil/parseutils.h" #include "libavutil/avstring.h" @@ -296,7 +297,12 @@ static int hls_write_header(AVFormatContext *s) ret = AVERROR(EINVAL); goto fail; } - + av_assert0(s->nb_streams == hls->avf->nb_streams); + for (i = 0; i < s->nb_streams; i++) { + AVStream *inner_st = hls->avf->streams[i]; + AVStream *outter_st = s->streams[i]; + avpriv_set_pts_info(outter_st, inner_st->pts_wrap_bits, inner_st->time_base.num, inner_st->time_base.den); + } fail: av_dict_free(&options);