summaryrefslogtreecommitdiff
path: root/src/lib/playlist.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-05-09 19:58:37 +0100
committerCarl Hetherington <cth@carlh.net>2016-05-18 11:50:29 +0100
commit19f94521139aac13ef8fb4eaa55855b2ada307b4 (patch)
tree6e4b457c1fa46c674433fb1a5d2a9cd0f07c5a11 /src/lib/playlist.cc
parent0a2d40420813403a96352c6dc895d23fcd9994c0 (diff)
Move video frame rate ('prepared-for') into Content.
Diffstat (limited to 'src/lib/playlist.cc')
-rw-r--r--src/lib/playlist.cc14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/lib/playlist.cc b/src/lib/playlist.cc
index 24a38f2cd..b473bee8a 100644
--- a/src/lib/playlist.cc
+++ b/src/lib/playlist.cc
@@ -266,14 +266,14 @@ Playlist::best_dcp_frame_rate () const
float this_error = 0;
BOOST_FOREACH (shared_ptr<Content> j, _content) {
- if (!j->video || !j->video->has_own_frame_rate()) {
+ if (!j->video || !j->video_frame_rate()) {
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 - j->video->frame_rate ())),
- float (fabs (i->source - j->video->frame_rate () * 2))
+ float (fabs (i->source - j->video_frame_rate().get())),
+ float (fabs (i->source - j->video_frame_rate().get() * 2))
);
/* Use the largest difference between DCP and source as the "error" */
@@ -375,7 +375,13 @@ Playlist::active_frame_rate_change (DCPTime t, int dcp_video_frame_rate) const
/* This is the first piece of content (going backwards...) that starts before t,
so it's the active one.
*/
- return FrameRateChange ((*i)->video->frame_rate(), dcp_video_frame_rate);
+ if ((*i)->video_frame_rate ()) {
+ /* This content specified a rate, so use it */
+ return FrameRateChange ((*i)->video_frame_rate().get(), dcp_video_frame_rate);
+ } else {
+ /* No specified rate so just use the DCP one */
+ return FrameRateChange (dcp_video_frame_rate, dcp_video_frame_rate);
+ }
}
}