diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-12-20 16:18:24 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-12-20 16:18:24 +0000 |
| commit | 3476f2f8251d5800abdd968963cac57b0df8a657 (patch) | |
| tree | dea2e82b66f7da44387023fe0c662253dfcec777 /src/tools | |
| parent | f8e6fdee828647bc5a6a1cc7627052a072a37dc6 (diff) | |
Allow content factory to return multiple content.
Diffstat (limited to 'src/tools')
| -rw-r--r-- | src/tools/dcpomatic.cc | 5 | ||||
| -rw-r--r-- | src/tools/dcpomatic_create.cc | 10 |
2 files changed, 10 insertions, 5 deletions
diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc index aa37f2fb7..097b7905a 100644 --- a/src/tools/dcpomatic.cc +++ b/src/tools/dcpomatic.cc @@ -76,6 +76,7 @@ #endif #include <boost/filesystem.hpp> #include <boost/noncopyable.hpp> +#include <boost/foreach.hpp> #include <iostream> #include <fstream> /* This is OK as it's only used with DCPOMATIC_WINDOWS */ @@ -1094,7 +1095,9 @@ private: if (!_film_to_create.empty ()) { _frame->new_film (_film_to_create, optional<string> ()); if (!_content_to_add.empty ()) { - _frame->film()->examine_and_add_content (content_factory (_frame->film(), _content_to_add)); + BOOST_FOREACH (shared_ptr<Content> i, content_factory (_frame->film(), _content_to_add)) { + _frame->film()->examine_and_add_content (i); + } } } diff --git a/src/tools/dcpomatic_create.cc b/src/tools/dcpomatic_create.cc index c14522a02..0582f5cac 100644 --- a/src/tools/dcpomatic_create.cc +++ b/src/tools/dcpomatic_create.cc @@ -32,6 +32,7 @@ #include "lib/cross.h" #include <libxml++/libxml++.h> #include <boost/filesystem.hpp> +#include <boost/foreach.hpp> #include <getopt.h> #include <string> #include <iostream> @@ -227,11 +228,12 @@ main (int argc, char* argv[]) film->set_signed (sign); for (int i = optind; i < argc; ++i) { - shared_ptr<Content> c = content_factory (film, boost::filesystem::canonical (argv[i])); - if (c->video) { - c->video->set_scale (VideoContentScale (content_ratio)); + BOOST_FOREACH (shared_ptr<Content> j, content_factory (film, boost::filesystem::canonical (argv[i]))) { + if (j->video) { + j->video->set_scale (VideoContentScale (content_ratio)); + } + film->examine_and_add_content (j); } - film->examine_and_add_content (c); } JobManager* jm = JobManager::instance (); |
