diff options
| author | Carl Hetherington <cth@carlh.net> | 2021-01-14 23:38:03 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2021-01-17 20:13:23 +0100 |
| commit | 6e1558f51d4f90c0adf6b18dc8143274167e4d89 (patch) | |
| tree | 522a9a383db1497947590c5a5e07b49ed3160749 /src | |
| parent | cb9fe95c4fee9d97c88d3f044cceb514fa753abb (diff) | |
Make subtitle checking robust to CPLs with no subs/ccaps in some reels.
Diffstat (limited to 'src')
| -rw-r--r-- | src/verify.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/verify.cc b/src/verify.cc index 44b3b657..dc435706 100644 --- a/src/verify.cc +++ b/src/verify.cc @@ -765,6 +765,7 @@ check_text_timing ( vector<shared_ptr<dcp::Reel>> reels, optional<int> picture_frame_rate, vector<VerificationNote>& notes, + std::function<bool (shared_ptr<dcp::Reel>)> check, std::function<string (shared_ptr<dcp::Reel>)> xml, std::function<int64_t (shared_ptr<dcp::Reel>)> duration ) @@ -805,6 +806,10 @@ check_text_timing ( }; for (auto i = 0U; i < reels.size(); ++i) { + if (!check(reels[i])) { + continue; + } + /* We need to look at <Subtitle> instances in the XML being checked, so we can't use the subtitles * read in by libdcp's parser. */ @@ -957,6 +962,9 @@ check_text_timing (vector<shared_ptr<dcp::Reel>> reels, vector<VerificationNote> if (reels[0]->main_subtitle()) { check_text_timing (reels, picture_frame_rate, notes, [](shared_ptr<dcp::Reel> reel) { + return static_cast<bool>(reel->main_subtitle()); + }, + [](shared_ptr<dcp::Reel> reel) { return reel->main_subtitle()->asset()->raw_xml(); }, [](shared_ptr<dcp::Reel> reel) { @@ -968,6 +976,9 @@ check_text_timing (vector<shared_ptr<dcp::Reel>> reels, vector<VerificationNote> for (auto i = 0U; i < reels[0]->closed_captions().size(); ++i) { check_text_timing (reels, picture_frame_rate, notes, [i](shared_ptr<dcp::Reel> reel) { + return i < reel->closed_captions().size(); + }, + [i](shared_ptr<dcp::Reel> reel) { return reel->closed_captions()[i]->asset()->raw_xml(); }, [i](shared_ptr<dcp::Reel> reel) { |
