From 19d89549667acbb0b7892d9583d08597f66be838 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Thu, 30 Aug 2012 23:41:16 +0200 Subject: [PATCH] find_stream_info: update last_dts more often This improves dts validity checks and consequently fps detection of files with invalid dts Fixes Ticket1681 Signed-off-by: Michael Niedermayer --- libavformat/utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/utils.c b/libavformat/utils.c index 301528d99e..4ce0a0c4e7 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -2721,7 +2721,7 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options) if (st->info->duration_count > 3) st->info->duration_gcd = av_gcd(st->info->duration_gcd, duration); } - if (last == AV_NOPTS_VALUE || st->info->duration_count <= 1) + if (pkt->dts != AV_NOPTS_VALUE) st->info->last_dts = pkt->dts; } #endif