From 7abe0aaa61fb98faf97c595ffaae86f3794217c6 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 25 Mar 2025 09:31:04 +0100 Subject: Adjust filter_notes to also handle the ignore_bv21_smpte flag. This fixes a problem where the Bv21 SMPTE warning appears in HTML reports. --- tools/common.cc | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) (limited to 'tools/common.cc') 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& notes, bool ignore_missing_assets) +vector +dcp::filter_notes(vector const& notes, bool ignore_missing_assets, bool ignore_bv21_smpte) { - if (!ignore_missing_assets) { - return; - } - vector 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; } -- cgit v1.2.3