Another macOS std::list boost::thread SNAFU.
[dcpomatic.git] / src / lib / empty.cc
index 68a153b0755d39a4869781847f12451fe042a4f8..206acfdb0a67d62131bb11c688906e68f01b49e2 100644 (file)
@@ -25,6 +25,7 @@
 #include "content_part.h"
 #include "dcp_content.h"
 #include "dcpomatic_time_coalesce.h"
+#include "piece.h"
 #include <boost/foreach.hpp>
 #include <iostream>
 
@@ -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<shared_ptr<ContentPart> (Content *)> part)
+Empty::Empty (shared_ptr<const Film> film, list<shared_ptr<Piece> > pieces, function<bool (shared_ptr<Piece>)> part)
 {
        list<DCPTimePeriod> full;
-       BOOST_FOREACH (shared_ptr<Content> i, content) {
-               if (part (i.get())) {
-                       full.push_back (DCPTimePeriod (i->position(), i->end()));
+       BOOST_FOREACH (shared_ptr<Piece> 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;