From 2c1faeb15715794525f48110c2b8a9df96b387c1 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 15 Mar 2021 01:36:51 +0100 Subject: Fix various bugs in subtitle/ccap verification. Check that subtitles don't overlap reel boundaries, and fix a few tests that trip this check. Fix confusion when calculating subtitle timings during verification where the picture asset frame rate was being used rather than the subtitle asset's edit rate. Do the subtitle timing verification for Interop as well as SMPTE subtitles. Take tags into account when checking subtitles, even though Bv2.1 says they should be set to 0. Rename Time::as_editable_units to Time::as_editable_units_ceil and add a _floor variant, then use that to round down when checking reel boundary overlaps. --- src/verify.cc | 76 +++++++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 53 insertions(+), 23 deletions(-) (limited to 'src/verify.cc') diff --git a/src/verify.cc b/src/verify.cc index bddf1683..97758e61 100644 --- a/src/verify.cc +++ b/src/verify.cc @@ -763,7 +763,7 @@ static void verify_text_timing ( vector> reels, - optional picture_frame_rate, + int edit_rate, vector& notes, std::function)> check, std::function)> xml, @@ -775,32 +775,39 @@ verify_text_timing ( auto too_short = false; auto too_close = false; auto too_early = false; + auto reel_overlap = false; /* current reel start time (in editable units) */ int64_t reel_offset = 0; - std::function parse; - parse = [&parse, &last_out, &too_short, &too_close, &too_early, &reel_offset](cxml::ConstNodePtr node, int tcr, int pfr, bool first_reel) { + std::function, optional