+DCPTime
+Playlist::subtitle_end () const
+{
+ DCPTime end;
+ BOOST_FOREACH (shared_ptr<Content> i, _content) {
+ if (i->subtitle) {
+ end = max (end, i->end ());
+ }
+ }
+
+ return end;
+}
+
+FrameRateChange
+Playlist::active_frame_rate_change (DCPTime t, int dcp_video_frame_rate) const
+{
+ for (ContentList::const_reverse_iterator i = _content.rbegin(); i != _content.rend(); ++i) {
+ if (!(*i)->video) {
+ continue;
+ }
+
+ if ((*i)->position() <= t) {
+ /* This is the first piece of content (going backwards...) that starts before t,
+ so it's the active one.
+ */
+ 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);
+ }
+ }
+ }
+
+ return FrameRateChange (dcp_video_frame_rate, dcp_video_frame_rate);
+}
+