2015-07-09 Carl Hetherington <cth@carlh.net>
+ * Improve 'best' frame rate guess in some cases (#633).
+
* Version 2.1.20 released.
2015-07-09 c.hetherington <cth@carlh.net>
continue;
}
+ /* Best error for this content; we could use the content as-is or double its rate */
+ float best_error = min (
+ float (fabs (i->source - vc->video_frame_rate ())),
+ float (fabs (i->source - vc->video_frame_rate () * 2))
+ );
+
/* Use the largest difference between DCP and source as the "error" */
- this_error = max (this_error, float (fabs (i->source - vc->video_frame_rate ())));
+ this_error = max (this_error, best_error);
}
if (this_error < error) {
A->_video_frame_rate = 30;
B->_video_frame_rate = 24;
BOOST_CHECK_EQUAL (film->best_video_frame_rate(), 25);
+
+ A->_video_frame_rate = 24;
+ B->_video_frame_rate = 24;
+ BOOST_CHECK_EQUAL (film->best_video_frame_rate(), 24);
+
+ A->_video_frame_rate = 24;
+ B->_video_frame_rate = 48;
+ BOOST_CHECK_EQUAL (film->best_video_frame_rate(), 24);
}
BOOST_AUTO_TEST_CASE (audio_sampling_rate_test)