summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/film.cc32
-rw-r--r--src/lib/reel_writer.cc2
2 files changed, 18 insertions, 16 deletions
diff --git a/src/lib/film.cc b/src/lib/film.cc
index d311c76cb..9f909633a 100644
--- a/src/lib/film.cc
+++ b/src/lib/film.cc
@@ -1563,29 +1563,29 @@ Film::reels () const
break;
case REELTYPE_BY_VIDEO_CONTENT:
{
- DCPTime last_split;
- shared_ptr<Content> last_video;
- BOOST_FOREACH (shared_ptr<Content> c, content ()) {
+ /* Collect all reel boundaries */
+ list<DCPTime> split_points;
+ split_points.push_back (DCPTime());
+ split_points.push_back (len);
+ BOOST_FOREACH (shared_ptr<Content> c, content()) {
if (c->video) {
BOOST_FOREACH (DCPTime t, c->reel_split_points(shared_from_this())) {
- if (last_split != t) {
- p.push_back (DCPTimePeriod(last_split, t));
- last_split = t;
- }
+ split_points.push_back (t);
}
- last_video = c;
+ split_points.push_back (c->end(shared_from_this()));
}
}
- DCPTime video_end = last_video ? last_video->end(shared_from_this()) : DCPTime(0);
- if (last_split != video_end) {
- /* Definitely go from the last split to the end of the video content */
- p.push_back (DCPTimePeriod(last_split, video_end));
- }
+ split_points.sort ();
+ split_points.unique ();
- if (video_end < len) {
- /* And maybe go after that as well if there is any non-video hanging over the end */
- p.push_back (DCPTimePeriod (video_end, len));
+ /* Make them into periods */
+ optional<DCPTime> last;
+ BOOST_FOREACH (DCPTime t, split_points) {
+ if (last) {
+ p.push_back (DCPTimePeriod(*last, t));
+ }
+ last = t;
}
break;
}
diff --git a/src/lib/reel_writer.cc b/src/lib/reel_writer.cc
index 67606cee2..8044973ec 100644
--- a/src/lib/reel_writer.cc
+++ b/src/lib/reel_writer.cc
@@ -439,6 +439,8 @@ maybe_add_text (
shared_ptr<dcp::Reel>
ReelWriter::create_reel (list<ReferencedReelAsset> const & refs, list<shared_ptr<Font> > const & fonts)
{
+ LOG_GENERAL ("create_reel for %1-%2; %3 of %4", _period.from.get(), _period.to.get(), _reel_index, _reel_count);
+
shared_ptr<dcp::Reel> reel (new dcp::Reel ());
shared_ptr<dcp::ReelPictureAsset> reel_picture_asset;