summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-02-15 04:14:53 +0100
committerMichael Niedermayer <michaelni@gmx.at>2011-02-15 04:19:31 +0100
commite24c05cd537a2d160ca008391cc7746c5bf7e025 (patch)
tree1a4d7f3e70f1b4c7f4b82f1fe7f6c096847e6a28 /libavformat
parentee028bbde9c1a9a14265bc8d6521c7539e3bde5d (diff)
Better threshold for the gcd based r_frame_rate calculation.
Fixes Gilmore Girls_Net 5_2011_01_08_16_10_53.wtv and RTL GP- WK Superbike - Qatar_RTL7_2009_03_14_15_49_23.wtv. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/utils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index c0f971efd3..3cae6c6844 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -2404,7 +2404,7 @@ int av_find_stream_info(AVFormatContext *ic)
// the check for tb_unreliable() is not completely correct, since this is not about handling
// a unreliable/inexact time base, but a time base that is finer than necessary, as e.g.
// ipmovie.c produces.
- if (tb_unreliable(st->codec) && st->info->duration_count > 15 && st->info->duration_gcd > 1 && !st->r_frame_rate.num)
+ if (tb_unreliable(st->codec) && st->info->duration_count > 15 && st->info->duration_gcd > FFMAX(1, st->time_base.den/(500LL*st->time_base.num)) && !st->r_frame_rate.num)
av_reduce(&st->r_frame_rate.num, &st->r_frame_rate.den, st->time_base.den, st->time_base.num * st->info->duration_gcd, INT_MAX);
if (st->info->duration_count && !st->r_frame_rate.num
&& tb_unreliable(st->codec) /*&&