summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2026-03-28 21:19:29 +0100
committerCarl Hetherington <cth@carlh.net>2026-03-28 21:19:29 +0100
commit4f1309aec7787765d3a15853d55245a86e7501c9 (patch)
tree389feb020b690b1fdc026d27e4c4ee2f713c7ab8 /src
parent1c42e6a464ad25a2230540f639fe513d2761d27d (diff)
Fix incorrect invalid FFOC check.
Diffstat (limited to 'src')
-rw-r--r--src/dcp_time.cc8
-rw-r--r--src/dcp_time.h2
-rw-r--r--src/verify.cc4
3 files changed, 12 insertions, 2 deletions
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
@@ -344,6 +344,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
{
return floor(int64_t(e) * double(tcr_) / tcr) + int64_t(s) * tcr_ + int64_t(m) * 60 * tcr_ + int64_t(h) * 60 * 60 * tcr_;
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<const CPL> 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);