]> git.sesse.net Git - ffmpeg/commitdiff
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 301528d99ed4c2b5b430a48d4f688b79aad06d69..4ce0a0c4e737d1fe8e3fcd2f3b0394cfa4437d8a 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