summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2025-03-30 23:25:17 +0200
committerCarl Hetherington <cth@carlh.net>2025-12-15 17:13:38 +0100
commit389ee9c72871f9047254ef8ad3de369787033dde (patch)
tree340546c633bd515561e78999e89b08c6ca6c7105
parentcf05a81a662013caf9d395ea8623d878c0815939 (diff)
Use new marker_position for INCORRECT_{F,L}FOC.
-rw-r--r--src/verify.cc11
-rw-r--r--src/verify.h16
-rw-r--r--test/verify_test.cc6
3 files changed, 23 insertions, 10 deletions
diff --git a/src/verify.cc b/src/verify.cc
index 3faa9648..ade9865c 100644
--- a/src/verify.cc
+++ b/src/verify.cc
@@ -1763,7 +1763,7 @@ verify_cpl(Context& context, shared_ptr<const CPL> cpl)
if (ffoc == markers_seen.end()) {
context.warning(VerificationNote::Code::MISSING_FFOC);
} else if (ffoc->second.e != 1) {
- context.warning(VerificationNote::Code::INCORRECT_FFOC, fmt::to_string(ffoc->second.e));
+ context.add_note(VN(VN::Type::WARNING, VN::Code::INCORRECT_FFOC).set_marker_position(ffoc->second.e));
}
auto lfoc = markers_seen.find(Marker::LFOC);
@@ -1772,7 +1772,7 @@ verify_cpl(Context& context, shared_ptr<const CPL> cpl)
} else {
auto lfoc_time = lfoc->second.as_editable_units_ceil(lfoc->second.tcr);
if (lfoc_time != (cpl->reels().back()->duration() - 1)) {
- context.warning(VerificationNote::Code::INCORRECT_LFOC, fmt::to_string(lfoc_time));
+ context.add_note(VN(VN::Type::WARNING, VN::Code::INCORRECT_LFOC).set_marker_position(lfoc_time));
}
}
@@ -2118,9 +2118,9 @@ dcp::note_to_string(VerificationNote note, function<string (string)> process_str
case VerificationNote::Code::MISSING_LFOC:
return process_string("There should be a LFOC (last frame of content) marker.");
case VerificationNote::Code::INCORRECT_FFOC:
- return compose("The FFOC marker is %1 instead of 1", note.note().get());
+ return compose("The FFOC marker is %1 instead of 1", note.marker_position().get());
case VerificationNote::Code::INCORRECT_LFOC:
- return compose("The LFOC marker is %1 instead of 1 less than the duration of the last reel.", note.note().get());
+ return compose("The LFOC marker is %1 instead of 1 less than the duration of the last reel.", note.marker_position().get());
case VerificationNote::Code::MISSING_CPL_METADATA:
return compose("The CPL %1 has no <CompositionMetadataAsset> tag.", note.cpl_id().get());
case VerificationNote::Code::MISSING_CPL_METADATA_VERSION_NUMBER:
@@ -2281,7 +2281,8 @@ dcp::operator== (dcp::VerificationNote const& a, dcp::VerificationNote const& b)
a.release_territory() == b.release_territory() &&
a.size_in_pixels() == b.size_in_pixels() &&
a.size_in_bytes() == b.size_in_bytes() &&
- a.bit_depth() == b.bit_depth();
+ a.bit_depth() == b.bit_depth() &&
+ a.marker_position() == b.marker_position();
}
diff --git a/src/verify.h b/src/verify.h
index 42875ef3..ce13cba6 100644
--- a/src/verify.h
+++ b/src/verify.h
@@ -313,11 +313,11 @@ public:
/** There should be a LFOC marker */
MISSING_LFOC,
/** The FFOC marker should be 1
- * note contains the incorrect value.
+ * marker_position contains the incorrect value.
*/
INCORRECT_FFOC,
/** The LFOC marker should be the last frame in the reel
- * note contains the incorrect value
+ * marker_position contains the incorrect value
*/
INCORRECT_LFOC,
/** There must be a _<CompositionMetadataAsset>_
@@ -621,7 +621,8 @@ private:
RELEASE_TERRITORY,
SIZE_IN_PIXELS,
SIZE_IN_BYTES,
- BIT_DEPTH
+ BIT_DEPTH,
+ MARKER_POSITION
};
template <class T>
@@ -868,6 +869,15 @@ public:
return data<int>(Data::BIT_DEPTH);
}
+ VerificationNote& set_marker_position(int64_t marker_position) {
+ _data[Data::MARKER_POSITION] = marker_position;
+ return *this;
+ }
+
+ boost::optional<int64_t> marker_position() const {
+ return data<int64_t>(Data::MARKER_POSITION);
+ }
+
private:
Type _type;
Code _code;
diff --git a/test/verify_test.cc b/test/verify_test.cc
index d6f0b213..94553c9c 100644
--- a/test/verify_test.cc
+++ b/test/verify_test.cc
@@ -4083,6 +4083,8 @@ verify_markers_test (
BOOST_AUTO_TEST_CASE (verify_markers)
{
+ using VN = dcp::VerificationNote;
+
verify_markers_test (
"build/test/verify_markers_all_correct",
{
@@ -4147,7 +4149,7 @@ BOOST_AUTO_TEST_CASE (verify_markers)
{ dcp::Marker::LFOC, dcp::Time(23, 24, 24) }
},
{
- { dcp::VerificationNote::Type::WARNING, dcp::VerificationNote::Code::INCORRECT_FFOC, string("3") }
+ VN(VN::Type::WARNING, VN::Code::INCORRECT_FFOC).set_marker_position(3)
});
verify_markers_test (
@@ -4159,7 +4161,7 @@ BOOST_AUTO_TEST_CASE (verify_markers)
{ dcp::Marker::LFOC, dcp::Time(18, 24, 24) }
},
{
- { dcp::VerificationNote::Type::WARNING, dcp::VerificationNote::Code::INCORRECT_LFOC, string("18") }
+ VN(VN::Type::WARNING, VN::Code::INCORRECT_LFOC).set_marker_position(18)
});
}