diff options
| author | Carl Hetherington <cth@carlh.net> | 2023-02-02 01:03:27 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2023-02-02 01:03:27 +0100 |
| commit | b424b9d40a472c00d2ddbe2218375dcbd3d947fc (patch) | |
| tree | 21e5f3858868b18d6008a3ba5b5169f3218b5381 /src | |
| parent | b1464249c7b403a66ca63f403c80c39f1af63e65 (diff) | |
Check IssueDate for Deluxe complaint.
Diffstat (limited to 'src')
| -rw-r--r-- | src/verify.cc | 14 | ||||
| -rw-r--r-- | src/verify.h | 8 |
2 files changed, 21 insertions, 1 deletions
diff --git a/src/verify.cc b/src/verify.cc index 8ea9ae97..61c41743 100644 --- a/src/verify.cc +++ b/src/verify.cc @@ -79,6 +79,7 @@ #include <boost/algorithm/string.hpp> #include <iostream> #include <map> +#include <regex> #include <set> #include <vector> @@ -726,6 +727,17 @@ verify_smpte_subtitle_asset ( } else { notes.push_back ({VerificationNote::Type::WARNING, VerificationNote::Code::MISSED_CHECK_OF_ENCRYPTED}); } + + if (asset->raw_xml()) { + /* Deluxe require this in their QC even if it seems never to be mentioned in any standard */ + cxml::Document doc("SubtitleReel"); + doc.read_string(*asset->raw_xml()); + auto issue_date = doc.string_child("IssueDate"); + std::regex reg("^\\d\\d\\d\\d-\\d\\d-\\d\\dT\\d\\d:\\d\\d:\\d\\d$"); + if (!std::regex_match(issue_date, reg)) { + notes.push_back({VerificationNote::Type::WARNING, VerificationNote::Code::INVALID_SUBTITLE_ISSUE_DATE, issue_date}); + } + } } @@ -1955,6 +1967,8 @@ dcp::note_to_string (VerificationNote note) return String::compose("The ASSETMAP %1 has more than one asset with the same ID", note.note().get()); case VerificationNote::Code::MISSING_SUBTITLE: return String::compose("The subtitle asset %1 has no subtitles", note.note().get()); + case VerificationNote::Code::INVALID_SUBTITLE_ISSUE_DATE: + return String::compose("<IssueDate> has an invalid value: %1", note.note().get()); } return ""; diff --git a/src/verify.h b/src/verify.h index 2e20bc31..1ddb7066 100644 --- a/src/verify.h +++ b/src/verify.h @@ -415,7 +415,13 @@ public: * note contains the asset ID * file contains the asset filename */ - MISSING_SUBTITLE + MISSING_SUBTITLE, + /** A SMPTE subtitle asset as an <IssueDate> which is not of the form yyyy-mm-ddThh:mm:ss + * I can find no reference in a standard to this being required, but the Deluxe delivery + * specifications require it and their QC will fail DCPs that don't have it. + * note contains the incorrect <IssueDate> + */ + INVALID_SUBTITLE_ISSUE_DATE }; VerificationNote (Type type, Code code) |
