summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2021-01-18 00:27:34 +0100
committerCarl Hetherington <cth@carlh.net>2021-01-18 00:27:34 +0100
commit2915c4f48129a4cac2c8ca364b09dd8047364aad (patch)
tree119434688e7d055c89cd9d54d15c6b068755f670 /src
parent6af628a0404e7135cb77cfa6d49a8419c883f2bf (diff)
Bv2.1 8.5: FFOC and LFOC should be present and have particular values.
Diffstat (limited to 'src')
-rw-r--r--src/verify.cc39
-rw-r--r--src/verify.h8
2 files changed, 36 insertions, 11 deletions
diff --git a/src/verify.cc b/src/verify.cc
index aa296fec..1cea1a0c 100644
--- a/src/verify.cc
+++ b/src/verify.cc
@@ -79,6 +79,7 @@ using std::string;
using std::cout;
using std::map;
using std::max;
+using std::set;
using std::shared_ptr;
using std::make_shared;
using boost::optional;
@@ -1084,10 +1085,7 @@ dcp::verify (
size_t fewest_closed_captions = SIZE_MAX;
/* most number of closed caption assets seen in a reel */
size_t most_closed_captions = 0;
- /* true if we've seen a FFEC marker */
- auto have_ffec = false;
- /* true if we've seen a FFMC marker */
- auto have_ffmc = false;
+ map<Marker, Time> markers_seen;
for (auto reel: cpl->reels()) {
stage ("Checking reel", optional<boost::filesystem::path>());
@@ -1158,11 +1156,8 @@ dcp::verify (
}
if (reel->main_markers()) {
- if (reel->main_markers()->get(Marker::FFEC)) {
- have_ffec = true;
- }
- if (reel->main_markers()->get(Marker::FFMC)) {
- have_ffmc = true;
+ for (auto const& i: reel->main_markers()->get()) {
+ markers_seen.insert (i);
}
}
@@ -1181,14 +1176,28 @@ dcp::verify (
}
if (cpl->content_kind() == FEATURE) {
- if (!have_ffec) {
+ if (markers_seen.find(dcp::Marker::FFEC) == markers_seen.end()) {
notes.push_back ({VerificationNote::VERIFY_BV21_ERROR, VerificationNote::MISSING_FFEC_IN_FEATURE});
}
- if (!have_ffmc) {
+ if (markers_seen.find(dcp::Marker::FFMC) == markers_seen.end()) {
notes.push_back ({VerificationNote::VERIFY_BV21_ERROR, VerificationNote::MISSING_FFMC_IN_FEATURE});
}
}
+ auto ffoc = markers_seen.find(dcp::Marker::FFOC);
+ if (ffoc == markers_seen.end()) {
+ notes.push_back ({VerificationNote::VERIFY_WARNING, VerificationNote::MISSING_FFOC});
+ } else if (ffoc->second.e != 1) {
+ notes.push_back ({VerificationNote::VERIFY_WARNING, VerificationNote::INCORRECT_FFOC});
+ }
+
+ auto lfoc = markers_seen.find(dcp::Marker::LFOC);
+ if (lfoc == markers_seen.end()) {
+ notes.push_back ({VerificationNote::VERIFY_WARNING, VerificationNote::MISSING_LFOC});
+ } else if (lfoc->second.as_editable_units(lfoc->second.tcr) != (cpl->reels().back()->duration() - 1)) {
+ notes.push_back ({VerificationNote::VERIFY_WARNING, VerificationNote::INCORRECT_LFOC});
+ }
+
check_text_timing (cpl->reels(), notes);
LinesCharactersResult result;
@@ -1347,6 +1356,14 @@ dcp::note_to_string (dcp::VerificationNote note)
return "The DCP is marked as a Feature but there is no FFEC (first frame of end credits) marker";
case dcp::VerificationNote::MISSING_FFMC_IN_FEATURE:
return "The DCP is marked as a Feature but there is no FFMC (first frame of moving credits) marker";
+ case dcp::VerificationNote::MISSING_FFOC:
+ return "There should be a FFOC (first frame of content) marker";
+ case dcp::VerificationNote::MISSING_LFOC:
+ return "There should be a LFOC (last frame of content) marker";
+ case dcp::VerificationNote::INCORRECT_FFOC:
+ return "The FFOC marker should bet set to 1";
+ case dcp::VerificationNote::INCORRECT_LFOC:
+ return "The LFOC marker should be set to 1 less than the duration of the last reel";
}
return "";
diff --git a/src/verify.h b/src/verify.h
index 5fb46a1b..05a49417 100644
--- a/src/verify.h
+++ b/src/verify.h
@@ -157,6 +157,14 @@ public:
MISSING_FFEC_IN_FEATURE,
/** If ContentKind is Feature there must be a FFMC marker */
MISSING_FFMC_IN_FEATURE,
+ /** There should be a FFOC */
+ MISSING_FFOC,
+ /** There should be a LFOC */
+ MISSING_LFOC,
+ /** The FFOC should be 1 */
+ INCORRECT_FFOC,
+ /** The LFOC should be the last frame in the reel */
+ INCORRECT_LFOC,
};
VerificationNote (Type type, Code code)