summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-07-09 20:36:17 +0100
committerCarl Hetherington <cth@carlh.net>2015-07-09 20:36:17 +0100
commit10e3bfad8164fc1bce19101253cd3bc9a1f973a3 (patch)
tree951e30675a5e74f817e979612aeb2ac289b0ff1d /src/lib
parenta1c0d5bbd239fa45a412e788da7f3bc9b7d1f89e (diff)
Guess a better optimum frame rate when there is content at 24 and 48 fps (#633).
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/playlist.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/lib/playlist.cc b/src/lib/playlist.cc
index a0afae0ad..e2135a60e 100644
--- a/src/lib/playlist.cc
+++ b/src/lib/playlist.cc
@@ -237,8 +237,14 @@ Playlist::best_dcp_frame_rate () const
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) {