summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2019-10-31 20:34:53 +0100
committerCarl Hetherington <cth@carlh.net>2019-11-11 21:27:42 +0100
commiteefc143f08e4b4dc26ebbd2136488f5c95e6cc2a (patch)
tree21f14a62763061eb76e650a1589c10b905cec498 /src/lib
parent63000b62c416961fae9b92c8da72a5febb6c4df1 (diff)
Fix incorrect reels when the first content is not at time 0.
With REELTYPE_BY_VIDEO_CONTENT the first reel would not start at 0. Backport of b950f49fa893e71545eaf9c0abe8a453d42a4340 from master.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/film.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/film.cc b/src/lib/film.cc
index 167ffaf4e..d311c76cb 100644
--- a/src/lib/film.cc
+++ b/src/lib/film.cc
@@ -1563,24 +1563,24 @@ Film::reels () const
break;
case REELTYPE_BY_VIDEO_CONTENT:
{
- optional<DCPTime> last_split;
+ DCPTime last_split;
shared_ptr<Content> last_video;
BOOST_FOREACH (shared_ptr<Content> c, content ()) {
if (c->video) {
BOOST_FOREACH (DCPTime t, c->reel_split_points(shared_from_this())) {
- if (last_split) {
- p.push_back (DCPTimePeriod (last_split.get(), t));
+ if (last_split != t) {
+ p.push_back (DCPTimePeriod(last_split, t));
+ last_split = t;
}
- last_split = t;
}
last_video = c;
}
}
DCPTime video_end = last_video ? last_video->end(shared_from_this()) : DCPTime(0);
- if (last_split) {
+ if (last_split != video_end) {
/* Definitely go from the last split to the end of the video content */
- p.push_back (DCPTimePeriod (last_split.get(), video_end));
+ p.push_back (DCPTimePeriod(last_split, video_end));
}
if (video_end < len) {