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 16:39:56 +0000 (17:39 +0100)
Fixes Ticket3980

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

libavformat/matroskadec.c

index 1d0f1b2..767fa5e 100644 (file)
@@ -1785,7 +1785,8 @@ static int matroska_read_header(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
             }