summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/cinema.cc2
-rw-r--r--src/lib/film.cc19
-rw-r--r--src/lib/util.cc2
3 files changed, 15 insertions, 8 deletions
diff --git a/src/lib/cinema.cc b/src/lib/cinema.cc
index ecd083f0a..7af4372f5 100644
--- a/src/lib/cinema.cc
+++ b/src/lib/cinema.cc
@@ -31,7 +31,7 @@ Cinema::Cinema (shared_ptr<const cxml::Node> node)
list<shared_ptr<cxml::Node> > s = node->node_children ("Screen");
for (list<shared_ptr<cxml::Node> >::iterator i = s.begin(); i != s.end(); ++i) {
- _screens.push_back (shared_ptr<Screen> (new Screen (*i)));
+ add_screen (shared_ptr<Screen> (new Screen (*i)));
}
}
diff --git a/src/lib/film.cc b/src/lib/film.cc
index 1e76dac2c..708876151 100644
--- a/src/lib/film.cc
+++ b/src/lib/film.cc
@@ -933,26 +933,31 @@ Film::make_kdms (
/* Find the DCP to make the KDM for */
string const dir = this->directory ();
- list<string> dcps;
+ list<boost::filesystem::path> dcps;
for (boost::filesystem::directory_iterator i = boost::filesystem::directory_iterator(dir); i != boost::filesystem::directory_iterator(); ++i) {
- if (boost::filesystem::is_directory (*i) && i->path().leaf() != "j2c" && i->path().leaf() != "wavs") {
- dcps.push_back (i->path().string());
+ if (boost::filesystem::is_directory (*i) && i->path().leaf() != "j2c" && i->path().leaf() != "video" && i->path().leaf() != "info") {
+ dcps.push_back (i->path());
}
}
if (dcps.empty()) {
- throw KDMError ("Could not find DCP to make KDM for");
+ throw KDMError (_("Could not find DCP to make KDM for"));
} else if (dcps.size() > 1) {
- throw KDMError ("More than one possible DCP to make KDM for");
+ throw KDMError (_("More than one possible DCP to make KDM for"));
}
for (list<shared_ptr<Screen> >::iterator i = screens.begin(); i != screens.end(); ++i) {
libdcp::DCP dcp (dcps.front ());
- dcp.read ();
+
+ try {
+ dcp.read ();
+ } catch (...) {
+ throw KDMError (_("Could not read DCP to make KDM for"));
+ }
shared_ptr<xmlpp::Document> kdm = dcp.cpls().front()->make_kdm (
- signer, (*i)->certificate, from, until, _interop, libdcp::MXFMetadata (), Config::instance()->dcp_metadata ()
+ signer, (*i)->certificate, key (), from, until, _interop, libdcp::MXFMetadata (), Config::instance()->dcp_metadata ()
);
boost::filesystem::path out = directory;
diff --git a/src/lib/util.cc b/src/lib/util.cc
index 4e4493ac7..667ee8ce9 100644
--- a/src/lib/util.cc
+++ b/src/lib/util.cc
@@ -275,6 +275,8 @@ dcpomatic_setup ()
#endif
avfilter_register_all ();
+
+ libdcp::init ();
Ratio::setup_ratios ();
DCPContentType::setup_dcp_content_types ();