Make it quicker to cancel an analyse subtitle job (#2486).
[dcpomatic.git] / src / lib / playlist.cc
index e8714e9d6d4ffedac4ab9dd6fc6ae83ee1efe66b..df7c95cc087333549a1e955d62e5811bb3102c49 100644 (file)
 */
 
 
-#include "playlist.h"
-#include "video_content.h"
-#include "text_content.h"
-#include "ffmpeg_decoder.h"
-#include "ffmpeg_content.h"
-#include "image_decoder.h"
 #include "audio_content.h"
+#include "compose.hpp"
+#include "config.h"
 #include "content_factory.h"
 #include "dcp_content.h"
+#include "digester.h"
+#include "ffmpeg_content.h"
+#include "ffmpeg_decoder.h"
+#include "image_decoder.h"
 #include "job.h"
-#include "config.h"
+#include "playlist.h"
+#include "text_content.h"
 #include "util.h"
-#include "digester.h"
-#include "compose.hpp"
+#include "video_content.h"
 #include <libcxml/cxml.h>
 #include <libxml++/libxml++.h>
 #include <boost/bind/placeholders.hpp>
 #include "i18n.h"
 
 
-using std::list;
 using std::cout;
-using std::vector;
-using std::min;
+using std::dynamic_pointer_cast;
+using std::list;
 using std::max;
-using std::string;
+using std::min;
 using std::pair;
-using boost::optional;
 using std::shared_ptr;
+using std::string;
+using std::vector;
 using std::weak_ptr;
-using std::dynamic_pointer_cast;
+using boost::optional;
 using namespace dcpomatic;
 #if BOOST_VERSION >= 106100
 using namespace boost::placeholders;
@@ -234,7 +234,7 @@ Playlist::set_from_xml (shared_ptr<const Film> film, cxml::ConstNodePtr node, in
 
                /* ...or have a start trim which is an integer number of frames */
                auto const old_trim = content->trim_start();
-               content->set_trim_start(old_trim);
+               content->set_trim_start(film, old_trim);
                if (old_trim != content->trim_start()) {
                        string note = _("Your project contains video content whose trim was not aligned to a frame boundary.");
                        note += "  ";
@@ -683,7 +683,7 @@ Playlist::content_summary (shared_ptr<const Film> film, DCPTimePeriod period) co
        int best_score = -1;
        for (auto i: content()) {
                int score = 0;
-               auto const o = DCPTimePeriod(i->position(), i->end(film)).overlap (period);
+               auto const o = i->period(film).overlap(period);
                if (o) {
                        score += 100 * o.get().duration().get() / period.duration().get();
                }