summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2025-03-30 12:55:59 +0200
committerCarl Hetherington <cth@carlh.net>2025-12-15 17:13:06 +0100
commit15b595ad8c982033f7c46fe5a18347660cec6f58 (patch)
treea7fc28e9d3309ab539092017d05672d8b3fea4cb /src
parentfdf2affa26f72d89e7e5386e14f4e1fce4c63129 (diff)
Use separate metadata for the mismatched asset ID error.
Diffstat (limited to 'src')
-rw-r--r--src/dcp.cc6
-rw-r--r--src/verify.cc13
-rw-r--r--src/verify.h24
3 files changed, 31 insertions, 12 deletions
diff --git a/src/dcp.cc b/src/dcp.cc
index 570ccfcc..c6610ecf 100644
--- a/src/dcp.cc
+++ b/src/dcp.cc
@@ -268,7 +268,11 @@ DCP::read (vector<dcp::VerificationNote>* notes, bool ignore_incorrect_picture_m
bool found_threed_marked_as_twod = false;
auto asset = asset_factory(path, ignore_incorrect_picture_mxf_type, &found_threed_marked_as_twod);
if (asset->id() != id) {
- notes->push_back(VerificationNote(VerificationNote::Type::ERROR, VerificationNote::Code::MISMATCHED_ASSET_MAP_ID).set_asset_id(id).set_other_asset_id(asset->id()));
+ notes->push_back(
+ VerificationNote(
+ VerificationNote::Type::ERROR,
+ VerificationNote::Code::MISMATCHED_ASSET_MAP_ID
+ ).set_mismatched_asset_id_from_asset_map(id).set_mismatched_asset_id_from_file(asset->id()));
}
other_assets.push_back(asset);
if (found_threed_marked_as_twod && notes) {
diff --git a/src/verify.cc b/src/verify.cc
index fcea8ac4..f3262a70 100644
--- a/src/verify.cc
+++ b/src/verify.cc
@@ -2191,7 +2191,7 @@ dcp::note_to_string(VerificationNote note, function<string (string)> process_str
case VerificationNote::Code::MISSING_LOAD_FONT:
return compose("The SMPTE subtitle asset %1 has <Text> nodes but no <LoadFont> node", note.asset_id().get());
case VerificationNote::Code::MISMATCHED_ASSET_MAP_ID:
- return compose("The asset with ID %1 in the asset map actually has an id of %2", note.asset_id().get(), note.other_asset_id().get());
+ return compose("The asset with ID %1 in the asset map actually has an id of %2", note.mismatched_asset_id_from_asset_map().get(), note.mismatched_asset_id_from_file().get());
case VerificationNote::Code::EMPTY_CONTENT_VERSION_LABEL_TEXT:
return compose("The <LabelText> in a <ContentVersion> in CPL %1 is empty", note.cpl_id().get());
case VerificationNote::Code::VALID_CONTENT_VERSION_LABEL_TEXT:
@@ -2221,7 +2221,8 @@ dcp::operator== (dcp::VerificationNote const& a, dcp::VerificationNote const& b)
a.size() == b.size() &&
a.load_font_id() == b.load_font_id() &&
a.asset_id() == b.asset_id() &&
- a.other_asset_id() == b.other_asset_id() &&
+ a.mismatched_asset_id_from_asset_map() == b.mismatched_asset_id_from_asset_map() &&
+ a.mismatched_asset_id_from_file() == b.mismatched_asset_id_from_file() &&
a.frame_rate() == b.frame_rate() &&
a.cpl_id() == b.cpl_id() &&
a.reference_hash() == b.reference_hash() &&
@@ -2280,8 +2281,12 @@ dcp::operator< (dcp::VerificationNote const& a, dcp::VerificationNote const& b)
return a.asset_id().get_value_or("") < b.asset_id().get_value_or("");
}
- if (a.other_asset_id() != b.other_asset_id()) {
- return a.other_asset_id().get_value_or("") < b.other_asset_id().get_value_or("");
+ if (a.mismatched_asset_id_from_asset_map() != b.mismatched_asset_id_from_asset_map()) {
+ return a.mismatched_asset_id_from_asset_map().get_value_or("") < b.mismatched_asset_id_from_asset_map().get_value_or("");
+ }
+
+ if (a.mismatched_asset_id_from_file() != b.mismatched_asset_id_from_file()) {
+ return a.mismatched_asset_id_from_file().get_value_or("") < b.mismatched_asset_id_from_file().get_value_or("");
}
if (a.cpl_id() != b.cpl_id()) {
diff --git a/src/verify.h b/src/verify.h
index 57d23ddb..24a3e5e1 100644
--- a/src/verify.h
+++ b/src/verify.h
@@ -529,8 +529,8 @@ public:
*/
MISSING_LOAD_FONT,
/** An ID in an asset map does not match the ID obtained from reading the actual file.
- * id contains the ID from the asset map.
- * other_id contains the ID from the file.
+ * mismatched_asset_id_from_asset_map contains the ID from the asset map.
+ * mismatched_asset_id_from_file contains the ID from the file.
*/
MISMATCHED_ASSET_MAP_ID,
/** The <LabelText> inside a _<ContentVersion>_ is empty
@@ -610,7 +610,8 @@ private:
SIZE,
LOAD_FONT_ID,
ASSET_ID,
- OTHER_ASSET_ID,
+ MISMATCHED_ASSET_ID_FROM_ASSET_MAP,
+ MISMATCHED_ASSET_ID_FROM_FILE,
FRAME_RATE,
CPL_ID,
CALCULATED_HASH,
@@ -686,13 +687,22 @@ public:
return data<std::string>(Data::ASSET_ID);
}
- VerificationNote& set_other_asset_id(std::string other_asset_id) {
- _data[Data::OTHER_ASSET_ID] = other_asset_id;
+ VerificationNote& set_mismatched_asset_id_from_asset_map(std::string asset_id) {
+ _data[Data::MISMATCHED_ASSET_ID_FROM_ASSET_MAP] = asset_id;
return *this;
}
- boost::optional<std::string> other_asset_id() const {
- return data<std::string>(Data::OTHER_ASSET_ID);
+ boost::optional<std::string> mismatched_asset_id_from_asset_map() const {
+ return data<std::string>(Data::MISMATCHED_ASSET_ID_FROM_ASSET_MAP);
+ }
+
+ VerificationNote& set_mismatched_asset_id_from_file(std::string asset_id) {
+ _data[Data::MISMATCHED_ASSET_ID_FROM_FILE] = asset_id;
+ return *this;
+ }
+
+ boost::optional<std::string> mismatched_asset_id_from_file() const {
+ return data<std::string>(Data::MISMATCHED_ASSET_ID_FROM_FILE);
}
VerificationNote& set_frame_rate(int frame_rate) {