diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-03-30 15:46:01 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-12-15 17:13:38 +0100 |
| commit | 3e463e2ea5b7f286c37ec8de9ecd8f636598ef24 (patch) | |
| tree | 4fd3403407d61a9817d301c77ac676cce5bcfb10 | |
| parent | 058d8539a29018668d330f9353759f6e8b9d0233 (diff) | |
Use asset_id for INCORRECT_SUBTITLE_NAMESPACE_COUNT.
| -rw-r--r-- | src/verify.cc | 8 | ||||
| -rw-r--r-- | src/verify.h | 2 | ||||
| -rw-r--r-- | test/verify_test.cc | 16 |
3 files changed, 14 insertions, 12 deletions
diff --git a/src/verify.cc b/src/verify.cc index 725bb92c..661119cc 100644 --- a/src/verify.cc +++ b/src/verify.cc @@ -835,11 +835,13 @@ verify_subtitle_asset(Context& context, shared_ptr<const TextAsset> asset, optio return count; }; + using VN = dcp::VerificationNote; + auto interop = dynamic_pointer_cast<const InteropTextAsset>(asset); if (interop) { verify_interop_text_asset(context, interop); if (namespace_count(asset, "DCSubtitle") > 1) { - context.warning(VerificationNote::Code::INCORRECT_SUBTITLE_NAMESPACE_COUNT, asset->id()); + context.add_note(VN(VN::Type::WARNING, VN::Code::INCORRECT_SUBTITLE_NAMESPACE_COUNT).set_asset_id(asset->id())); } } @@ -849,7 +851,7 @@ verify_subtitle_asset(Context& context, shared_ptr<const TextAsset> asset, optio verify_smpte_subtitle_asset(context, smpte); /* This asset may be encrypted and in that case we'll have no raw_xml() */ if (asset->raw_xml() && namespace_count(asset, "SubtitleReel") > 1) { - context.warning(VerificationNote::Code::INCORRECT_SUBTITLE_NAMESPACE_COUNT, asset->id()); + context.add_note(VN(VN::Type::WARNING, VN::Code::INCORRECT_SUBTITLE_NAMESPACE_COUNT).set_asset_id(asset->id())); } } } @@ -2196,7 +2198,7 @@ dcp::note_to_string(VerificationNote note, function<string (string)> process_str note.frame().get(), note.component().get(), note.size().get() ); case VerificationNote::Code::INCORRECT_SUBTITLE_NAMESPACE_COUNT: - return compose("The XML in the subtitle asset %1 has more than one namespace declaration.", note.note().get()); + return compose("The XML in the subtitle asset %1 has more than one namespace declaration.", note.asset_id().get()); case VerificationNote::Code::MISSING_LOAD_FONT_FOR_FONT: return compose("A subtitle or closed caption refers to a font with ID %1 that does not have a corresponding <LoadFont> node", note.load_font_id().get()); case VerificationNote::Code::MISSING_LOAD_FONT: diff --git a/src/verify.h b/src/verify.h index 113114d8..3500fce4 100644 --- a/src/verify.h +++ b/src/verify.h @@ -516,7 +516,7 @@ public: */ INVALID_JPEG2000_TILE_PART_SIZE, /** A subtitle XML root node has more than one namespace (xmlns) declaration. - * note contains the asset ID + * asset_id contains the asset ID */ INCORRECT_SUBTITLE_NAMESPACE_COUNT, /** A subtitle or closed caption file has a _<Font>_ tag which refers to a font that is not diff --git a/test/verify_test.cc b/test/verify_test.cc index a0fa9959..4a8be514 100644 --- a/test/verify_test.cc +++ b/test/verify_test.cc @@ -1406,8 +1406,8 @@ BOOST_AUTO_TEST_CASE (verify_valid_smpte_subtitles) dcp::VerificationNote::Type::WARNING, dcp::VerificationNote::Code::INVALID_SUBTITLE_ISSUE_DATE, string{"2021-04-14T13:19:14.000+02:00"} ).set_cpl_id(cpl->id()).set_reel_index(0), dcp::VerificationNote( - dcp::VerificationNote::Type::WARNING, dcp::VerificationNote::Code::INCORRECT_SUBTITLE_NAMESPACE_COUNT, asset->id() - ).set_cpl_id(cpl->id()).set_reel_index(0), + dcp::VerificationNote::Type::WARNING, dcp::VerificationNote::Code::INCORRECT_SUBTITLE_NAMESPACE_COUNT + ).set_asset_id(asset->id()).set_cpl_id(cpl->id()).set_reel_index(0), }); } @@ -1454,8 +1454,8 @@ BOOST_AUTO_TEST_CASE (verify_invalid_smpte_subtitles) dcp::VerificationNote::Type::WARNING, dcp::VerificationNote::Code::INVALID_SUBTITLE_ISSUE_DATE, string{"2020-05-09T00:29:21.000+02:00"} ).set_cpl_id(cpl->id()).set_reel_index(0), dcp::VerificationNote( - dcp::VerificationNote::Type::WARNING, dcp::VerificationNote::Code::INCORRECT_SUBTITLE_NAMESPACE_COUNT, asset->id() - ).set_cpl_id(cpl->id()).set_reel_index(0) + dcp::VerificationNote::Type::WARNING, dcp::VerificationNote::Code::INCORRECT_SUBTITLE_NAMESPACE_COUNT + ).set_asset_id(asset->id()).set_cpl_id(cpl->id()).set_reel_index(0) }); } @@ -1495,8 +1495,8 @@ BOOST_AUTO_TEST_CASE (verify_empty_text_node_in_subtitles) dcp::VerificationNote::Type::WARNING, dcp::VerificationNote::Code::INVALID_SUBTITLE_ISSUE_DATE, string{"2021-08-09T18:34:46.000+02:00"} ).set_cpl_id(cpl->id()).set_reel_index(0), dcp::VerificationNote( - dcp::VerificationNote::Type::WARNING, dcp::VerificationNote::Code::INCORRECT_SUBTITLE_NAMESPACE_COUNT, asset->id() - ).set_cpl_id(cpl->id()).set_reel_index(0) + dcp::VerificationNote::Type::WARNING, dcp::VerificationNote::Code::INCORRECT_SUBTITLE_NAMESPACE_COUNT + ).set_asset_id(asset->id()).set_cpl_id(cpl->id()).set_reel_index(0) }); } @@ -5679,8 +5679,8 @@ BOOST_AUTO_TEST_CASE(verify_too_many_subtitle_namespaces) dcp::VerificationNote::Type::BV21_ERROR, dcp::VerificationNote::Code::MISSING_CPL_METADATA, canonical(find_file(dir, "cpl_")) ).set_cpl_id(cpl->id()), dcp::VerificationNote( - dcp::VerificationNote::Type::WARNING, dcp::VerificationNote::Code::INCORRECT_SUBTITLE_NAMESPACE_COUNT, std::string{"315de731-1173-484c-9a35-bdacf5a9d99d"} - ).set_cpl_id(cpl->id()).set_reel_index(0), + dcp::VerificationNote::Type::WARNING, dcp::VerificationNote::Code::INCORRECT_SUBTITLE_NAMESPACE_COUNT + ).set_asset_id("315de731-1173-484c-9a35-bdacf5a9d99d").set_cpl_id(cpl->id()).set_reel_index(0), }); } |
