X-Git-Url: https://git.carlh.net/gitweb/?p=dcpomatic.git;a=blobdiff_plain;f=src%2Ftools%2Fdcpomatic_create.cc;h=62428b1a24484990e287d8f147f59e3e5d84b829;hp=44c7987bcd661eed59d2085b5be1a8ce65842a3e;hb=b0fc1ec3b159b7a7fa917f2e338485921800374e;hpb=cc83f20bacf7c012f1d02a83aa06151a2c693062 diff --git a/src/tools/dcpomatic_create.cc b/src/tools/dcpomatic_create.cc index 44c7987bc..62428b1a2 100644 --- a/src/tools/dcpomatic_create.cc +++ b/src/tools/dcpomatic_create.cc @@ -45,6 +45,7 @@ #include #include + using std::cerr; using std::cout; using std::dynamic_pointer_cast; @@ -53,15 +54,17 @@ using std::list; using std::make_shared; using std::shared_ptr; using std::string; +using std::vector; using boost::optional; + class SimpleSignalManager : public SignalManager { public: /* Do nothing in this method so that UI events happen in our thread when we call SignalManager::ui_idle(). */ - void wake_ui () {} + void wake_ui () override {} }; int @@ -117,12 +120,17 @@ main (int argc, char* argv[]) for (auto cli_content: cc.content) { auto const can = boost::filesystem::canonical (cli_content.path); - list> film_content_list; + vector> film_content_list; if (boost::filesystem::exists (can / "ASSETMAP") || (boost::filesystem::exists (can / "ASSETMAP.xml"))) { auto dcp = make_shared(can); film_content_list.push_back (dcp); - dcp->add_kdm (dcp::EncryptedKDM(dcp::file_to_string(*cli_content.kdm))); + if (cli_content.kdm) { + dcp->add_kdm (dcp::EncryptedKDM(dcp::file_to_string(*cli_content.kdm))); + } + if (cli_content.cpl) { + dcp->set_cpl(*cli_content.cpl); + } } else { /* I guess it's not a DCP */ film_content_list = content_factory (can); @@ -171,8 +179,10 @@ main (int argc, char* argv[]) if (jm->errors ()) { for (auto i: jm->get()) { if (i->finished_in_error()) { - cerr << i->error_summary() << "\n" - << i->error_details() << "\n"; + cerr << i->error_summary() << "\n"; + if (!i->error_details().empty()) { + cout << i->error_details() << "\n"; + } } } exit (EXIT_FAILURE);