Move raw_convert into libdcp.
[dcpomatic.git] / src / lib / dcp_content.cc
index dbbd65077b85c871457f994164274b5bb2603dcf..9e767596cf7619e34ae6673a53d21c054036496a 100644 (file)
@@ -35,7 +35,6 @@
 #include <dcp/reel.h>
 #include <libxml++/libxml++.h>
 #include <boost/foreach.hpp>
-#include <boost/make_shared.hpp>
 #include <iterator>
 #include <iostream>
 
@@ -48,10 +47,10 @@ using std::pair;
 using std::vector;
 using std::list;
 using boost::shared_ptr;
-using boost::make_shared;
 using boost::scoped_ptr;
 using boost::optional;
 using boost::function;
+using dcp::raw_convert;
 
 int const DCPContentProperty::CAN_BE_PLAYED      = 600;
 int const DCPContentProperty::REFERENCE_VIDEO    = 601;
@@ -134,7 +133,7 @@ DCPContent::examine (shared_ptr<Job> job)
        job->set_progress_unknown ();
        Content::examine (job);
 
-       shared_ptr<DCPExaminer> examiner = make_shared<DCPExaminer> (shared_from_this ());
+       shared_ptr<DCPExaminer> examiner (new DCPExaminer (shared_from_this ()));
        video->take_from_examiner (examiner);
        set_default_colour_conversion ();
 
@@ -241,14 +240,13 @@ DCPContent::full_length () const
 string
 DCPContent::identifier () const
 {
-       SafeStringStream s;
-       s << Content::identifier() << "_" << video->identifier() << "_";
+       string s = Content::identifier() + "_" + video->identifier() + "_";
        if (subtitle) {
-               s << subtitle->identifier () << " ";
+               s += subtitle->identifier () + " ";
        }
-       s << (_reference_video ? "1" : "0")
-         << (_reference_subtitle ? "1" : "0");
-       return s.str ();
+
+       s += string (_reference_video ? "1" : "0") + string (_reference_subtitle ? "1" : "0");
+       return s;
 }
 
 void
@@ -334,7 +332,7 @@ DCPContent::reels () const
        list<DCPTimePeriod> p;
        scoped_ptr<DCPDecoder> decoder;
        try {
-               decoder.reset (new DCPDecoder (shared_from_this(), film()->log(), false));
+               decoder.reset (new DCPDecoder (shared_from_this(), film()->log()));
        } catch (...) {
                /* Could not load the DCP; guess reels */
                list<DCPTimePeriod> p;
@@ -405,7 +403,7 @@ DCPContent::can_reference_video (list<string>& why_not) const
 bool
 DCPContent::can_reference_audio (list<string>& why_not) const
 {
-        DCPDecoder decoder (shared_from_this(), film()->log(), false);
+        DCPDecoder decoder (shared_from_this(), film()->log());
         BOOST_FOREACH (shared_ptr<dcp::Reel> i, decoder.reels()) {
                 if (!i->main_sound()) {
                         why_not.push_back (_("The DCP does not have sound in all reels."));
@@ -419,7 +417,7 @@ DCPContent::can_reference_audio (list<string>& why_not) const
 bool
 DCPContent::can_reference_subtitle (list<string>& why_not) const
 {
-        DCPDecoder decoder (shared_from_this(), film()->log(), false);
+        DCPDecoder decoder (shared_from_this(), film()->log());
         BOOST_FOREACH (shared_ptr<dcp::Reel> i, decoder.reels()) {
                 if (!i->main_subtitle()) {
                         why_not.push_back (_("The DCP does not have subtitles in all reels."));