matroska-demux: Allow a bit more variation when detecting common framerates

Instead of +/- 1ns we allow 2ns now. Due to rounding errors there are
some Matroska files out there with 33.333331ms per frame for 30fps.
This commit is contained in:
Sebastian Dröge 2013-11-26 11:17:42 +01:00
parent 20ad174679
commit fb14f66696

View file

@ -4930,7 +4930,7 @@ gst_duration_to_fraction (guint64 duration, gint * dest_n, gint * dest_d)
d = common_den[i];
n = floor (0.5 + (d * 1e9) / duration);
a = gst_util_uint64_scale_int (1000000000, d, n);
if (duration >= a - 1 && duration <= a + 1) {
if (duration >= a - 2 && duration <= a + 2) {
goto out;
}
}