From 1ed9eb5a595a46ae6b523bc34a3ed4667a44c6f1 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Thu, 3 Nov 2011 14:31:01 +0100 Subject: [PATCH] lavf: Do not set cur_dts to undetermined before first_dts has been calculated as this would upset the start_time and first_dts calculation. Signed-off-by: Michael Niedermayer --- libavformat/utils.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavformat/utils.c b/libavformat/utils.c index 2cf42d3c43..333946c172 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -1415,7 +1415,8 @@ void ff_read_frame_flush(AVFormatContext *s) av_free_packet(&st->cur_pkt); } st->last_IP_pts = AV_NOPTS_VALUE; - st->cur_dts = AV_NOPTS_VALUE; /* we set the current DTS to an unspecified origin */ + if(st->first_dts == AV_NOPTS_VALUE) st->cur_dts = 0; + else st->cur_dts = AV_NOPTS_VALUE; /* we set the current DTS to an unspecified origin */ st->reference_dts = AV_NOPTS_VALUE; /* fail safe */ st->cur_ptr = NULL;