From: Carl Hetherington Date: Tue, 23 May 2017 10:52:50 +0000 (+0100) Subject: Speculative fix for adding DCPs to projects with dcpomatic2_create. X-Git-Tag: v2.11.7~5 X-Git-Url: https://git.carlh.net/gitweb/?p=dcpomatic.git;a=commitdiff_plain;h=7659ccaf9e5624e4fba40fb4f9d68f8c402203bd Speculative fix for adding DCPs to projects with dcpomatic2_create. --- diff --git a/src/tools/dcpomatic_create.cc b/src/tools/dcpomatic_create.cc index 136fbf9c0..1f9a5b7ec 100644 --- a/src/tools/dcpomatic_create.cc +++ b/src/tools/dcpomatic_create.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2013-2016 Carl Hetherington + Copyright (C) 2013-2017 Carl Hetherington This file is part of DCP-o-matic. @@ -30,6 +30,8 @@ #include "lib/image_content.h" #include "lib/video_content.h" #include "lib/cross.h" +#include "lib/dcp_content.h" +#include #include #include #include @@ -234,7 +236,16 @@ main (int argc, char* argv[]) film->set_signed (sign); for (int i = optind; i < argc; ++i) { - BOOST_FOREACH (shared_ptr j, content_factory (film, boost::filesystem::canonical (argv[i]))) { + boost::filesystem::path const can = boost::filesystem::canonical (argv[i]); + list > content; + try { + content.push_back (shared_ptr (new DCPContent (film, can))); + } catch (dcp::DCPReadError& e) { + /* I guess it's not a DCP */ + content = content_factory (film, can); + } + + BOOST_FOREACH (shared_ptr j, content) { if (j->video) { j->video->set_scale (VideoContentScale (content_ratio)); }