X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fempty.cc;h=00baaeb141e86a7d4a12ae7abb5181ed583f055b;hb=dd9be86db6cde0afa5da0d1d1ac43b42e05dca26;hp=98bf1f3d186e2619d864706e82dbebde22b2b108;hpb=19c8f785894306bfa7998775d462f7f80cde8eaf;p=dcpomatic.git diff --git a/src/lib/empty.cc b/src/lib/empty.cc index 98bf1f3d1..00baaeb14 100644 --- a/src/lib/empty.cc +++ b/src/lib/empty.cc @@ -25,25 +25,27 @@ #include "content_part.h" #include "dcp_content.h" #include "dcpomatic_time_coalesce.h" +#include "piece.h" #include #include using std::cout; using std::list; -using boost::shared_ptr; -using boost::dynamic_pointer_cast; +using std::shared_ptr; +using std::dynamic_pointer_cast; using boost::function; +using namespace dcpomatic; -Empty::Empty (shared_ptr film, function (Content *)> part) +Empty::Empty (shared_ptr film, shared_ptr playlist, function)> part, DCPTime length) { list full; - BOOST_FOREACH (shared_ptr i, film->content()) { - if (part (i.get())) { - full.push_back (DCPTimePeriod (i->position(), i->end())); + BOOST_FOREACH (shared_ptr i, playlist->content()) { + if (part(i)) { + full.push_back (DCPTimePeriod (i->position(), i->end(film))); } } - _periods = subtract (DCPTimePeriod(DCPTime(), film->length()), coalesce(full)); + _periods = subtract (DCPTimePeriod(DCPTime(), length), coalesce(full)); if (!_periods.empty ()) { _position = _periods.front().from;