diff options
| author | Carl Hetherington <cth@carlh.net> | 2022-03-28 00:23:16 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2022-03-28 00:23:16 +0200 |
| commit | 6a77d4a19541446008ab4c457d0fbeb256712d39 (patch) | |
| tree | e2be0151b93da06157046f6a92d28ff471320628 /src/lib/text_content.cc | |
| parent | 72b0ae6df82b5e54e3f135f0c341f564a8bd7bc2 (diff) | |
WIP: hacks to allow joining of files which don't all have subtitle streams.2187-examine-vobs
Diffstat (limited to 'src/lib/text_content.cc')
| -rw-r--r-- | src/lib/text_content.cc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/lib/text_content.cc b/src/lib/text_content.cc index 87bb2db46..e65469541 100644 --- a/src/lib/text_content.cc +++ b/src/lib/text_content.cc @@ -258,15 +258,18 @@ TextContent::TextContent (Content* parent, cxml::ConstNodePtr node, int version, TextContent::TextContent (Content* parent, vector<shared_ptr<Content>> content) : ContentPart (parent) { - /* This constructor is for join which is only supported for content types - that have a single text, so we can use only_text() here. - */ - auto ref = content[0]->only_text(); + auto ref_iter = std::find_if(content.begin(), content.end(), [](shared_ptr<Content> c) { return !c->text.empty(); }); + DCPOMATIC_ASSERT (ref_iter != content.end()); + auto ref = (*ref_iter)->only_text(); DCPOMATIC_ASSERT (ref); auto ref_fonts = ref->fonts (); for (size_t i = 1; i < content.size(); ++i) { + if (content[i]->text.empty()) { + continue; + } + if (content[i]->only_text()->use() != ref->use()) { throw JoinError (_("Content to be joined must have the same 'use subtitles' setting.")); } |
