avformat/matroskadec: do not trust the default duration to be the real 1/timebase...
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 8 Oct 2014 18:23:40 +0000 (20:23 +0200)
committerCarl Eugen Hoyos <cehoyos@ag.or.at>
Sat, 1 Nov 2014 14:48:58 +0000 (15:48 +0100)
Fixes Ticket3980

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit be695ee389724d713e1b8a61ef899fe1795193ce)

libavformat/matroskadec.c

index fdfba57..ea0b5ab 100644 (file)
@@ -1979,7 +1979,8 @@ static int matroska_parse_tracks(AVFormatContext *s)
                 av_reduce(&st->avg_frame_rate.num, &st->avg_frame_rate.den,
                           1000000000, track->default_duration, 30000);
 #if FF_API_R_FRAME_RATE
-                if (st->avg_frame_rate.num < st->avg_frame_rate.den * 1000L)
+                if (   st->avg_frame_rate.num < st->avg_frame_rate.den * 1000L
+                    && st->avg_frame_rate.num > st->avg_frame_rate.den * 5L)
                     st->r_frame_rate = st->avg_frame_rate;
 #endif
             }