X-Git-Url: https://main.carlh.net/gitweb/?p=dcpomatic.git;a=blobdiff_plain;f=src%2Flib%2Fempty.cc;h=206acfdb0a67d62131bb11c688906e68f01b49e2;hp=68a153b0755d39a4869781847f12451fe042a4f8;hb=1befa3d286a5016e897f1a23cc60cd3d3b96e63a;hpb=7a3f4f1b6411f7d15bf00e863fb5e70a5d930dd8 diff --git a/src/lib/empty.cc b/src/lib/empty.cc index 68a153b07..206acfdb0 100644 --- a/src/lib/empty.cc +++ b/src/lib/empty.cc @@ -25,6 +25,7 @@ #include "content_part.h" #include "dcp_content.h" #include "dcpomatic_time_coalesce.h" +#include "piece.h" #include #include @@ -33,17 +34,18 @@ using std::list; using boost::shared_ptr; using boost::dynamic_pointer_cast; using boost::function; +using namespace dcpomatic; -Empty::Empty (ContentList content, DCPTime length, function (Content *)> part) +Empty::Empty (shared_ptr film, list > pieces, function)> part) { list full; - BOOST_FOREACH (shared_ptr i, content) { - if (part (i.get())) { - full.push_back (DCPTimePeriod (i->position(), i->end())); + BOOST_FOREACH (shared_ptr i, pieces) { + if (part(i)) { + full.push_back (DCPTimePeriod (i->content->position(), i->content->end(film))); } } - _periods = subtract (DCPTimePeriod(DCPTime(), length), coalesce(full)); + _periods = subtract (DCPTimePeriod(DCPTime(), film->length()), coalesce(full)); if (!_periods.empty ()) { _position = _periods.front().from;