summaryrefslogtreecommitdiff
path: root/src/lib/playlist.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-07-14 14:23:50 +0100
committerCarl Hetherington <cth@carlh.net>2015-07-14 14:23:50 +0100
commit23b69b228ed5b34b59e1789de4bff052bc905ae4 (patch)
treef2c4f3bdfd80d1fe3d3b3dc7800e2d2589693680 /src/lib/playlist.cc
parentf509c806965f4a381eec454e7f55a70fd676f302 (diff)
Express trims using ContentTime so that they do not change
when DCP frame rate is changed (#637).
Diffstat (limited to 'src/lib/playlist.cc')
-rw-r--r--src/lib/playlist.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/lib/playlist.cc b/src/lib/playlist.cc
index e2135a60e..4e46fdbdf 100644
--- a/src/lib/playlist.cc
+++ b/src/lib/playlist.cc
@@ -303,13 +303,16 @@ Playlist::video_end () const
FrameRateChange
Playlist::active_frame_rate_change (DCPTime t, int dcp_video_frame_rate) const
{
- for (ContentList::const_iterator i = _content.begin(); i != _content.end(); ++i) {
+ for (ContentList::const_reverse_iterator i = _content.rbegin(); i != _content.rend(); ++i) {
shared_ptr<const VideoContent> vc = dynamic_pointer_cast<const VideoContent> (*i);
if (!vc) {
continue;
}
- if (vc->position() >= t && t < vc->end()) {
+ if (vc->position() <= t) {
+ /* This is the first piece of content (going backwards...) that starts before t,
+ so it's the active one.
+ */
return FrameRateChange (vc->video_frame_rate(), dcp_video_frame_rate);
}
}