diff options
| author | Carl Hetherington <cth@carlh.net> | 2017-05-23 11:52:50 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2017-05-23 11:52:50 +0100 |
| commit | 7659ccaf9e5624e4fba40fb4f9d68f8c402203bd (patch) | |
| tree | f7f367b4060c13161b143021d9586fcb1b752b97 /src/tools | |
| parent | a02fbffd265d1434e4ef451aad8c4e95264f41e5 (diff) | |
Speculative fix for adding DCPs to projects with dcpomatic2_create.
Diffstat (limited to 'src/tools')
| -rw-r--r-- | src/tools/dcpomatic_create.cc | 15 |
1 files changed, 13 insertions, 2 deletions
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 <cth@carlh.net> + Copyright (C) 2013-2017 Carl Hetherington <cth@carlh.net> 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 <dcp/exceptions.h> #include <libxml++/libxml++.h> #include <boost/filesystem.hpp> #include <boost/foreach.hpp> @@ -234,7 +236,16 @@ main (int argc, char* argv[]) film->set_signed (sign); for (int i = optind; i < argc; ++i) { - BOOST_FOREACH (shared_ptr<Content> j, content_factory (film, boost::filesystem::canonical (argv[i]))) { + boost::filesystem::path const can = boost::filesystem::canonical (argv[i]); + list<shared_ptr<Content> > content; + try { + content.push_back (shared_ptr<DCPContent> (new DCPContent (film, can))); + } catch (dcp::DCPReadError& e) { + /* I guess it's not a DCP */ + content = content_factory (film, can); + } + + BOOST_FOREACH (shared_ptr<Content> j, content) { if (j->video) { j->video->set_scale (VideoContentScale (content_ratio)); } |
