diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-03-30 13:50:43 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-12-15 17:13:37 +0100 |
| commit | 913054919460df766f5c54ff369c871f0d5fa2b0 (patch) | |
| tree | f21b8f252e778da1392e15dd627a229fa5b4a90e | |
| parent | 33c43b13a500f41f494962da22af8634826f0a1c (diff) | |
Use frame_rate for INVALID_PICTURE_FRAME_RATE.
| -rw-r--r-- | src/verify.cc | 9 | ||||
| -rw-r--r-- | src/verify.h | 2 | ||||
| -rw-r--r-- | test/verify_test.cc | 8 |
3 files changed, 12 insertions, 7 deletions
diff --git a/src/verify.cc b/src/verify.cc index 3614f752..9370296c 100644 --- a/src/verify.cc +++ b/src/verify.cc @@ -1450,7 +1450,12 @@ verify_reel( frame_rate.numerator != 50 && frame_rate.numerator != 60 && frame_rate.numerator != 96)) { - context.error(VerificationNote::Code::INVALID_PICTURE_FRAME_RATE, String::compose("%1/%2", frame_rate.numerator, frame_rate.denominator)); + context.add_note( + dcp::VerificationNote( + dcp::VerificationNote::Type::ERROR, + VerificationNote::Code::INVALID_PICTURE_FRAME_RATE + ).set_frame_rate(frame_rate) + ); } /* Check asset */ if (reel->main_picture()->asset_ref().resolved()) { @@ -1947,7 +1952,7 @@ dcp::note_to_string(VerificationNote note, function<string (string)> process_str case VerificationNote::Code::MISMATCHED_CPL_HASHES: return compose("The hash (%1) of the CPL (%2) in the PKL does not agree with the CPL file (%3).", note.reference_hash().get(), note.cpl_id().get(), note.calculated_hash().get()); case VerificationNote::Code::INVALID_PICTURE_FRAME_RATE: - return compose("The picture in a reel has an invalid frame rate %1.", note.note().get()); + return compose("The picture in a reel has an invalid frame rate %1.", note.frame_rate()->as_string()); case VerificationNote::Code::INCORRECT_PICTURE_HASH: return compose("The hash (%1) of the picture asset %2 does not agree with the PKL file (%3).", note.calculated_hash().get(), filename(), note.reference_hash().get()); case VerificationNote::Code::CORRECT_PICTURE_HASH: diff --git a/src/verify.h b/src/verify.h index 8281cfe0..e4ebf7f0 100644 --- a/src/verify.h +++ b/src/verify.h @@ -113,7 +113,7 @@ public: */ MISMATCHED_CPL_HASHES, /** The frame rate given in a reel for the main picture is not 24, 25, 30, 48, 50 or 60 - * note contains the invalid frame rate as "<numerator>/<denominator>" + * frame_rate contains the frame rate */ INVALID_PICTURE_FRAME_RATE, /** The hash of a main picture asset agrees with the PKL file */ diff --git a/test/verify_test.cc b/test/verify_test.cc index ef429a64..164d077d 100644 --- a/test/verify_test.cc +++ b/test/verify_test.cc @@ -684,8 +684,8 @@ BOOST_AUTO_TEST_CASE (verify_invalid_picture_frame_rate) dcp::VerificationNote::Type::ERROR, dcp::VerificationNote::Code::MISMATCHED_CPL_HASHES, canonical(cpl_path) ).set_cpl_id(cpl->id()).set_calculated_hash("7n7GQ2TbxQbmHYuAR8ml7XDOep8=").set_reference_hash("skI+5b/9LA/y6h0mcyxysJYanxI="), dcp::VerificationNote( - dcp::VerificationNote::Type::ERROR, dcp::VerificationNote::Code::INVALID_PICTURE_FRAME_RATE, string{"99/1"} - ).set_cpl_id(cpl->id()).set_reel_index(0) + dcp::VerificationNote::Type::ERROR, dcp::VerificationNote::Code::INVALID_PICTURE_FRAME_RATE + ).set_frame_rate(dcp::Fraction(99, 1)).set_cpl_id(cpl->id()).set_reel_index(0) }; check_verify_result(dcp::verify({dir}, {}, &stage, &progress, {}, xsd_test).notes, expected); @@ -2013,8 +2013,8 @@ check_picture_size_bad_2k_frame_rate (int width, int height, int frame_rate, boo ok(dcp::VerificationNote::Code::CORRECT_PICTURE_HASH, canonical(dir / "video.mxf"), cpl).set_reel_index(0), ok(dcp::VerificationNote::Code::VALID_PICTURE_FRAME_SIZES_IN_BYTES, canonical(dir / "video.mxf"), cpl).set_reel_index(0), dcp::VerificationNote( - dcp::VerificationNote::Type::ERROR, dcp::VerificationNote::Code::INVALID_PICTURE_FRAME_RATE, dcp::String::compose("%1/1", frame_rate * (three_d ? 2 : 1)) - ).set_cpl_id(cpl->id()).set_reel_index(0), + dcp::VerificationNote::Type::ERROR, dcp::VerificationNote::Code::INVALID_PICTURE_FRAME_RATE + ).set_frame_rate(dcp::Fraction(frame_rate * (three_d ? 2 : 1), 1)).set_cpl_id(cpl->id()).set_reel_index(0), dcp::VerificationNote( dcp::VerificationNote::Type::BV21_ERROR, dcp::VerificationNote::Code::INVALID_PICTURE_FRAME_RATE_FOR_2K, dcp::String::compose("%1/1", frame_rate), canonical(dir / "video.mxf") ).set_cpl_id(cpl->id()).set_reel_index(0) |
