diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-07-15 14:20:23 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-07-15 14:20:23 +0100 |
| commit | c044402e6c0262b4813ffee6e8df53469cef8487 (patch) | |
| tree | da4ec232521cce993df40fd337764ac93314d0a8 /src/lib/playlist.cc | |
| parent | bbd20953701383dddc4c45d2ab317d55845d8b89 (diff) | |
Decide best DCP rate based on the largest difference between a particular content's frame rate and the DCP one, rather than a sum of all the differences.
Diffstat (limited to 'src/lib/playlist.cc')
| -rw-r--r-- | src/lib/playlist.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/playlist.cc b/src/lib/playlist.cc index 9e7f7f5f5..703a14663 100644 --- a/src/lib/playlist.cc +++ b/src/lib/playlist.cc @@ -221,7 +221,7 @@ Playlist::best_dcp_frame_rate () const candidates.push_back (FrameRateCandidate (float (*i) * 2, *i)); } - /* Pick the best one, bailing early if we hit an exact match */ + /* Pick the best one */ float error = std::numeric_limits<float>::max (); optional<FrameRateCandidate> best; list<FrameRateCandidate>::iterator i = candidates.begin(); @@ -234,7 +234,8 @@ Playlist::best_dcp_frame_rate () const continue; } - this_error += fabs (i->source - vc->video_frame_rate ()); + /* Use the largest difference between DCP and source as the "error" */ + this_error = max (this_error, float (fabs (i->source - vc->video_frame_rate ()))); } if (this_error < error) { |
