From 4f1309aec7787765d3a15853d55245a86e7501c9 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 28 Mar 2026 21:19:29 +0100 Subject: Fix incorrect invalid FFOC check. --- src/dcp_time.cc | 8 ++++++++ src/dcp_time.h | 2 ++ src/verify.cc | 4 ++-- 3 files changed, 12 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/dcp_time.cc b/src/dcp_time.cc index f08f2b1c..75986ae5 100644 --- a/src/dcp_time.cc +++ b/src/dcp_time.cc @@ -343,6 +343,14 @@ Time::as_string (Standard standard) const } +int64_t +Time::as_editable_units() const +{ + return int64_t(e) + int64_t(s) * tcr + int64_t(m) * 60 * tcr + int64_t(h) * 60 * 60 * tcr; + +} + + int64_t Time::as_editable_units_floor (int tcr_) const { diff --git a/src/dcp_time.h b/src/dcp_time.h index 21b59921..58ea0ae5 100644 --- a/src/dcp_time.h +++ b/src/dcp_time.h @@ -126,6 +126,8 @@ public: /** @return the total number of seconds that this time consists of */ double as_seconds () const; + int64_t as_editable_units() const; + /** @param tcr_ Timecode rate with which the return value should be counted * @return the total number of editable units that this time consists of at the specified timecode rate, rounded down * to the nearest editable unit. For example, as_editable_units_floor(24) returns the total time in frames at 24fps. diff --git a/src/verify.cc b/src/verify.cc index f071f53e..c2ef0d41 100644 --- a/src/verify.cc +++ b/src/verify.cc @@ -1725,8 +1725,8 @@ verify_cpl(Context& context, shared_ptr cpl) auto ffoc = markers_seen.find(Marker::FFOC); if (ffoc == markers_seen.end()) { context.add_note(VerificationNote::Code::MISSING_FFOC); - } else if (ffoc->second.e != 1) { - context.add_note(VerificationNote::Code::INCORRECT_FFOC, fmt::to_string(ffoc->second.e)); + } else if (ffoc->second.as_editable_units() != 1) { + context.add_note(VerificationNote::Code::INCORRECT_FFOC, fmt::to_string(ffoc->second.as_editable_units())); } auto lfoc = markers_seen.find(Marker::LFOC); -- cgit v1.2.3