diff options
| -rw-r--r-- | src/verify.cc | 13 | ||||
| -rw-r--r-- | src/verify.h | 3 | ||||
| -rw-r--r-- | test/verify_test.cc | 12 |
3 files changed, 15 insertions, 13 deletions
diff --git a/src/verify.cc b/src/verify.cc index 88bebbc6..3055a33b 100644 --- a/src/verify.cc +++ b/src/verify.cc @@ -735,9 +735,9 @@ verify_smpte_timed_text_asset ( if (reel_asset_duration && *reel_asset_duration != asset->intrinsic_duration()) { context.add_note( - VerificationNote::Code::MISMATCHED_TIMED_TEXT_DURATION, - String::compose("%1 %2", *reel_asset_duration, asset->intrinsic_duration()), - asset->file().get() + VerificationNote( + VerificationNote::Code::MISMATCHED_TIMED_TEXT_DURATION, *asset->file() + ).set_duration(asset->intrinsic_duration()).set_other_duration(*reel_asset_duration) ); } } @@ -2156,12 +2156,7 @@ dcp::note_to_string(VerificationNote note, function<string (string)> process_str case VerificationNote::Code::INCORRECT_TIMED_TEXT_ASSET_ID: return process_string("The Asset ID in a timed text MXF is the same as the Resource ID or that of the contained XML."); case VerificationNote::Code::MISMATCHED_TIMED_TEXT_DURATION: - { - vector<string> parts; - boost::split (parts, note.note().get(), boost::is_any_of(" ")); - DCP_ASSERT (parts.size() == 2); - return compose("The reel duration of some timed text (%1) is not the same as the ContainerDuration of its MXF (%2).", parts[0], parts[1]); - } + return compose("The reel duration of some timed text (%1) is not the same as the ContainerDuration of its MXF (%2).", *note.other_duration(), *note.duration()); case VerificationNote::Code::MISSED_CHECK_OF_ENCRYPTED: return process_string("Some aspect of this DCP could not be checked because it is encrypted."); case VerificationNote::Code::EMPTY_TEXT: diff --git a/src/verify.h b/src/verify.h index 0b16c8ae..21ef1857 100644 --- a/src/verify.h +++ b/src/verify.h @@ -467,7 +467,8 @@ public: */ INCORRECT_TIMED_TEXT_ASSET_ID, /** The ContainerDuration of a timed text MXF is not the same as the _Duration_ in its reel [Bv2.1_10.4.3] - * note contains the reel duration, followed by a space, followed by the MXF duration + * duration contains the MXF duration + * other_duration contains the reel duration * file contains the asset filename * reel_index contains the reel index (starting from 0) */ diff --git a/test/verify_test.cc b/test/verify_test.cc index 0f954cd1..e334d412 100644 --- a/test/verify_test.cc +++ b/test/verify_test.cc @@ -2889,7 +2889,9 @@ BOOST_AUTO_TEST_CASE (verify_subtitle_overlapping_reel_boundary) note(VC::MATCHING_PKL_ANNOTATION_TEXT_WITH_CPL, cpl), note(VC::VALID_CONTENT_KIND, string{"trailer"}, cpl), note(VC::VALID_CONTENT_VERSION_LABEL_TEXT, cpl->content_version()->label_text, cpl), - VN(VC::MISMATCHED_TIMED_TEXT_DURATION , "72 96", boost::filesystem::canonical(asset->file().get())).set_cpl_id(cpl->id()).set_reel_index(0).set_asset_id(asset->id()), + VN( + VC::MISMATCHED_TIMED_TEXT_DURATION, boost::filesystem::canonical(asset->file().get()) + ).set_cpl_id(cpl->id()).set_reel_index(0).set_asset_id(asset->id()).set_duration(96).set_other_duration(72), VN(VC::INVALID_SUBTITLE_FIRST_TEXT_TIME).set_cpl_id(cpl->id()).set_reel_index(0).set_asset_id(asset->id()), VN(VC::SUBTITLE_OVERLAPS_REEL_BOUNDARY).set_cpl_id(cpl->id()).set_reel_index(0).set_asset_id(asset->id()), VN(VC::MISSING_CPL_METADATA, cpl->file().get()).set_cpl_id(cpl->id()) @@ -4925,7 +4927,9 @@ BOOST_AUTO_TEST_CASE (verify_mismatched_subtitle_resource_id) note(VC::VALID_CONTENT_VERSION_LABEL_TEXT, cpl->content_version()->label_text, cpl), note(VC::MATCHING_CPL_HASHES, cpl), note(VC::VALID_CONTENT_KIND, string{"trailer"}, cpl), - VN(VC::MISMATCHED_TIMED_TEXT_DURATION , "240 0", boost::filesystem::canonical(subs_mxf)).set_cpl_id(cpl->id()).set_reel_index(0).set_asset_id(subs_asset->id()), + VN( + VC::MISMATCHED_TIMED_TEXT_DURATION, boost::filesystem::canonical(subs_mxf) + ).set_cpl_id(cpl->id()).set_reel_index(0).set_asset_id(subs_asset->id()).set_duration(0).set_other_duration(240), VN(VC::MISMATCHED_TIMED_TEXT_RESOURCE_ID).set_cpl_id(cpl->id()).set_reel_index(0).set_asset_id(subs_asset->id()), VN(VC::INVALID_SUBTITLE_FIRST_TEXT_TIME).set_cpl_id(cpl->id()).set_reel_index(0).set_asset_id(subs_asset->id()), VN(VC::MISSING_CPL_METADATA, cpl->file().get()).set_cpl_id(cpl->id()) @@ -5000,7 +5004,9 @@ BOOST_AUTO_TEST_CASE (verify_incorrect_timed_text_id) note(VC::VALID_CONTENT_VERSION_LABEL_TEXT, cpl->content_version()->label_text, cpl), note(VC::MATCHING_CPL_HASHES, cpl), note(VC::VALID_CONTENT_KIND, string{"trailer"}, cpl), - VN(VC::MISMATCHED_TIMED_TEXT_DURATION , "240 0", boost::filesystem::canonical(subs_mxf)).set_cpl_id(cpl->id()).set_reel_index(0).set_asset_id(subs_asset->id()), + VN( + VC::MISMATCHED_TIMED_TEXT_DURATION, boost::filesystem::canonical(subs_mxf) + ).set_cpl_id(cpl->id()).set_reel_index(0).set_asset_id(subs_asset->id()).set_duration(0).set_other_duration(240), VN(VC::INCORRECT_TIMED_TEXT_ASSET_ID).set_cpl_id(cpl->id()).set_reel_index(0).set_asset_id(subs_asset->id()), VN(VC::INVALID_SUBTITLE_FIRST_TEXT_TIME).set_cpl_id(cpl->id()).set_reel_index(0).set_asset_id(subs_asset->id()), VN(VC::MISSING_CPL_METADATA, cpl->file().get()).set_cpl_id(cpl->id()), |
