X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Ffilm.cc;h=7088761511c0bc6262d4b0508b4de04202fc5ab7;hb=f0380b3df50ca48ad2f22b5e7d5544dc9fa30d61;hp=1e76dac2cab8e8b900100ca1fb0b73fe82a6aec0;hpb=1ba7bca7f2950faa441ec83920d35b65016f3fa6;p=dcpomatic.git 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 dcps; + list 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 >::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 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;