summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2024-03-16 18:02:35 +0100
committerCarl Hetherington <cth@carlh.net>2024-03-16 18:02:40 +0100
commit6c11fdfda7a0f306f894b15b56b72d3c4898013d (patch)
tree54ef2103adc52a512a642b22deb3b2402d9fc1c1 /src
parentb395d79069cf64fd3a552fb843a31affa57662de (diff)
Allow SMPTE timecodes with 3 digits in the editable units field.
It seems that these should only be present if the timecode rate is 101 or above, and in that case all timecodes should have 3 editable rate digits, but someone sent a DCP from what seems to be EasyDCP Creator and it has one timecode of 00:05:01:000.
Diffstat (limited to 'src')
-rw-r--r--src/dcp_time.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/dcp_time.cc b/src/dcp_time.cc
index e21eaf27..f08f2b1c 100644
--- a/src/dcp_time.cc
+++ b/src/dcp_time.cc
@@ -147,7 +147,8 @@ Time::Time (string time, optional<int> tcr_)
}
} else {
- /* SMPTE: HH:MM:SS:EE */
+ /* SMPTE: HH:MM:SS:EE[E].
+ * It seems like there can be any number of E digits but let's just allow 2 or 3 */
split (b, time, is_any_of (":"));
if (b.size() != 4) {
boost::throw_exception (ReadError (String::compose ("unrecognised time specification %1; does not have 4 parts", time)));
@@ -159,7 +160,7 @@ Time::Time (string time, optional<int> tcr_)
boost::throw_exception (ReadError (String::compose ("unrecognised time specification %1; %2 has bad length", time, b[2])));
}
s = raw_convert<int> (b[2]);
- if (b[3].empty() || b[3].length() > 2) {
+ if (b[3].empty() || b[3].length() > 3) {
boost::throw_exception (ReadError (String::compose ("unrecognised time specification %1; %2 has bad length", time, b[3])));
}
e = raw_convert<int> (b[3]);