diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-03-25 09:31:04 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-03-25 09:31:04 +0100 |
| commit | 7abe0aaa61fb98faf97c595ffaae86f3794217c6 (patch) | |
| tree | 0ddca26ea47b1acd5c8f5a53dca8fe4d16a93ee7 /tools/common.cc | |
| parent | 8edb46702b372b6e672d0ac8f810e151e1aa5707 (diff) | |
Adjust filter_notes to also handle the ignore_bv21_smpte flag.
This fixes a problem where the Bv21 SMPTE warning appears in HTML
reports.
Diffstat (limited to 'tools/common.cc')
| -rw-r--r-- | tools/common.cc | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/tools/common.cc b/tools/common.cc index 030a2ce7..64a1eaf7 100644 --- a/tools/common.cc +++ b/tools/common.cc @@ -40,20 +40,28 @@ using std::shared_ptr; using std::vector; -void -dcp::filter_notes (vector<dcp::VerificationNote>& notes, bool ignore_missing_assets) +vector<dcp::VerificationNote> +dcp::filter_notes(vector<dcp::VerificationNote> const& notes, bool ignore_missing_assets, bool ignore_bv21_smpte) { - if (!ignore_missing_assets) { - return; - } - vector<dcp::VerificationNote> filtered; - std::copy_if (notes.begin(), notes.end(), std::back_inserter(filtered), [](dcp::VerificationNote const& i) { - return i.code() != dcp::VerificationNote::Code::MISSING_ASSET && - i.code() != dcp::VerificationNote::Code::EXTERNAL_ASSET && - i.code() != dcp::VerificationNote::Code::MISSING_FONT; + std::copy_if(notes.begin(), notes.end(), std::back_inserter(filtered), [ignore_missing_assets, ignore_bv21_smpte](dcp::VerificationNote const& i) { + bool const missing = ( + i.code() == dcp::VerificationNote::Code::MISSING_ASSET || + i.code() == dcp::VerificationNote::Code::EXTERNAL_ASSET || + i.code() == dcp::VerificationNote::Code::MISSING_FONT + ); + + if (ignore_missing_assets && missing) { + return false; + } + + if (ignore_bv21_smpte && i.code() == dcp::VerificationNote::Code::INVALID_STANDARD) { + return false; + } + + return true; }); - notes = filtered; + return filtered; } |
