find_stream_info: update last_dts more often
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 30 Aug 2012 21:41:16 +0000 (23:41 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 30 Aug 2012 21:48:54 +0000 (23:48 +0200)
This improves dts validity checks and consequently fps detection of files with invalid dts
Fixes Ticket1681

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/utils.c

index 301528d..4ce0a0c 100644 (file)
@@ -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