diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-07-21 16:53:58 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-07-21 16:53:58 +0100 |
| commit | ac35bf2a80c9afae9dc5fcb0261929053162f44d (patch) | |
| tree | 278ecb512c1dcc090b6e3fb38acf198afdb2b579 /src/lib | |
| parent | 504d613d3d7e8fbd3135e4e479ced1f51f520a04 (diff) | |
Adapt to changes in libdcp1 wrt shared_ptr and Certificate.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/cinema.cc | 8 | ||||
| -rw-r--r-- | src/lib/cinema.h | 4 | ||||
| -rw-r--r-- | src/lib/config.cc | 4 | ||||
| -rw-r--r-- | src/lib/film.cc | 6 | ||||
| -rw-r--r-- | src/lib/film.h | 2 |
5 files changed, 15 insertions, 9 deletions
diff --git a/src/lib/cinema.cc b/src/lib/cinema.cc index c8cb7b66c..620236186 100644 --- a/src/lib/cinema.cc +++ b/src/lib/cinema.cc @@ -70,14 +70,18 @@ Cinema::remove_screen (shared_ptr<Screen> s) Screen::Screen (cxml::ConstNodePtr node) { name = node->string_child ("Name"); - certificate = shared_ptr<dcp::Certificate> (new dcp::Certificate (node->string_child ("Certificate"))); + if (node->optional_string_child ("Certificate")) { + certificate = dcp::Certificate (node->string_child ("Certificate")); + } } void Screen::as_xml (xmlpp::Element* parent) const { parent->add_child("Name")->add_child_text (name); - parent->add_child("Certificate")->add_child_text (certificate->certificate (true)); + if (certificate) { + parent->add_child("Certificate")->add_child_text (certificate->certificate (true)); + } } diff --git a/src/lib/cinema.h b/src/lib/cinema.h index 74357f65d..8421f4687 100644 --- a/src/lib/cinema.h +++ b/src/lib/cinema.h @@ -36,7 +36,7 @@ class Cinema; class Screen { public: - Screen (std::string const & n, boost::shared_ptr<dcp::Certificate> cert) + Screen (std::string const & n, boost::optional<dcp::Certificate> cert) : name (n) , certificate (cert) {} @@ -47,7 +47,7 @@ public: boost::shared_ptr<Cinema> cinema; std::string name; - boost::shared_ptr<dcp::Certificate> certificate; + boost::optional<dcp::Certificate> certificate; }; /** @class Cinema diff --git a/src/lib/config.cc b/src/lib/config.cc index 0d6a55054..1fd4792c3 100644 --- a/src/lib/config.cc +++ b/src/lib/config.cc @@ -217,7 +217,7 @@ Config::read () /* Read the signing certificates and private key in from the config file */ list<cxml::NodePtr> certificates = signer->node_children ("Certificate"); for (list<cxml::NodePtr>::const_iterator i = certificates.begin(); i != certificates.end(); ++i) { - signer_chain.add (shared_ptr<dcp::Certificate> (new dcp::Certificate ((*i)->content ()))); + signer_chain.add (dcp::Certificate ((*i)->content ())); } _signer.reset (new dcp::Signer (signer_chain, signer->string_child ("PrivateKey"))); @@ -353,7 +353,7 @@ Config::write () const xmlpp::Element* signer = root->add_child ("Signer"); dcp::CertificateChain::List certs = _signer->certificates().root_to_leaf (); for (dcp::CertificateChain::List::const_iterator i = certs.begin(); i != certs.end(); ++i) { - signer->add_child("Certificate")->add_child_text ((*i)->certificate (true)); + signer->add_child("Certificate")->add_child_text (i->certificate (true)); } signer->add_child("PrivateKey")->add_child_text (_signer->key ()); diff --git a/src/lib/film.cc b/src/lib/film.cc index 99a668e37..0de6f2ded 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -1076,7 +1076,7 @@ Film::frame_size () const dcp::EncryptedKDM Film::make_kdm ( - shared_ptr<dcp::Certificate> target, + dcp::Certificate target, boost::filesystem::path cpl_file, dcp::LocalTime from, dcp::LocalTime until, @@ -1106,7 +1106,9 @@ Film::make_kdms ( list<dcp::EncryptedKDM> kdms; for (list<shared_ptr<Screen> >::iterator i = screens.begin(); i != screens.end(); ++i) { - kdms.push_back (make_kdm ((*i)->certificate, dcp, from, until, formulation)); + if ((*i)->certificate) { + kdms.push_back (make_kdm ((*i)->certificate.get(), dcp, from, until, formulation)); + } } return kdms; diff --git a/src/lib/film.h b/src/lib/film.h index dea669d98..c9b4602ad 100644 --- a/src/lib/film.h +++ b/src/lib/film.h @@ -121,7 +121,7 @@ public: dcp::EncryptedKDM make_kdm ( - boost::shared_ptr<dcp::Certificate> target, + dcp::Certificate target, boost::filesystem::path cpl_file, dcp::LocalTime from, dcp::LocalTime until, |
