summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2026-03-22 21:49:51 +0100
committerCarl Hetherington <cth@carlh.net>2026-03-22 23:51:00 +0100
commitf5d9e1e12f0fd3c25ca921e60126443b3a2cd240 (patch)
tree16d16a38cca642419bb8b0153123f1d57d532b73 /src
parent2fca6ad9716429660e7162807582db00c3ca6865 (diff)
Use a dcp::Fraction for verification note frame rate.
Diffstat (limited to 'src')
-rw-r--r--src/verify.cc10
-rw-r--r--src/verify.h7
-rw-r--r--src/verify_j2k.cc4
3 files changed, 11 insertions, 10 deletions
diff --git a/src/verify.cc b/src/verify.cc
index 59208779..23d05633 100644
--- a/src/verify.cc
+++ b/src/verify.cc
@@ -480,14 +480,14 @@ verify_picture_details(
context.add_note(
VerificationNote(
VerificationNote::Code::INVALID_PICTURE_FRAME_SIZE_IN_BYTES, file
- ).set_frame(start_frame + index).set_frame_rate(frame_rate).set_reel_index(0)
+ ).set_frame(start_frame + index).set_frame_rate(dcp::Fraction(frame_rate, 1)).set_reel_index(0)
);
any_bad_frames_seen = true;
} else if (size > risky_frame) {
context.add_note(
VerificationNote(
VerificationNote::Code::NEARLY_INVALID_PICTURE_FRAME_SIZE_IN_BYTES, file
- ).set_frame(start_frame + index).set_frame_rate(frame_rate).set_reel_index(0)
+ ).set_frame(start_frame + index).set_frame_rate(dcp::Fraction(frame_rate, 1)).set_reel_index(0)
);
any_bad_frames_seen = true;
}
@@ -1981,14 +1981,14 @@ dcp::note_to_string(VerificationNote note, function<string (string)> process_str
return compose(
"Frame %1 (timecode %2) in asset %3 has an instantaneous bit rate that is larger than the limit of 250Mbit/s.",
note.frame().get(),
- dcp::Time(note.frame().get(), note.frame_rate().get(), note.frame_rate().get()).as_string(dcp::Standard::SMPTE),
+ dcp::Time(note.frame().get(), note.frame_rate()->as_float(), note.frame_rate()->numerator).as_string(dcp::Standard::SMPTE),
filename()
);
case VerificationNote::Code::NEARLY_INVALID_PICTURE_FRAME_SIZE_IN_BYTES:
return compose(
"Frame %1 (timecode %2) in asset %3 has an instantaneous bit rate that is close to the limit of 250Mbit/s.",
note.frame().get(),
- dcp::Time(note.frame().get(), note.frame_rate().get(), note.frame_rate().get()).as_string(dcp::Standard::SMPTE),
+ dcp::Time(note.frame().get(), note.frame_rate()->as_float(), note.frame_rate()->numerator).as_string(dcp::Standard::SMPTE),
filename()
);
case VerificationNote::Code::EXTERNAL_ASSET:
@@ -2107,7 +2107,7 @@ dcp::note_to_string(VerificationNote note, function<string (string)> process_str
return compose(
"Frame %1 (timecode %2) has an invalid JPEG2000 codestream (%3).",
note.frame().get(),
- dcp::Time(note.frame().get(), note.frame_rate().get(), note.frame_rate().get()).as_string(dcp::Standard::SMPTE),
+ dcp::Time(note.frame().get(), note.frame_rate()->as_float(), note.frame_rate()->numerator).as_string(dcp::Standard::SMPTE),
note.note().get()
);
case VerificationNote::Code::INVALID_JPEG2000_GUARD_BITS_FOR_2K:
diff --git a/src/verify.h b/src/verify.h
index af84a77f..ad74f1f2 100644
--- a/src/verify.h
+++ b/src/verify.h
@@ -42,6 +42,7 @@
#include "decrypted_kdm.h"
+#include "types.h"
#include <boost/any.hpp>
#include <boost/filesystem.hpp>
#include <boost/function.hpp>
@@ -711,13 +712,13 @@ public:
return data<std::string>(Data::OTHER_ASSET_ID);
}
- VerificationNote& set_frame_rate(int frame_rate) {
+ VerificationNote& set_frame_rate(dcp::Fraction frame_rate) {
_data[Data::FRAME_RATE] = frame_rate;
return *this;
}
- boost::optional<int> frame_rate() const {
- return data<int>(Data::FRAME_RATE);
+ boost::optional<dcp::Fraction> frame_rate() const {
+ return data<dcp::Fraction>(Data::FRAME_RATE);
}
VerificationNote& set_calculated_hash(std::string hash) {
diff --git a/src/verify_j2k.cc b/src/verify_j2k.cc
index dcea6f60..c53a1af0 100644
--- a/src/verify_j2k.cc
+++ b/src/verify_j2k.cc
@@ -225,7 +225,7 @@ dcp::verify_j2k(shared_ptr<const Data> j2k, int start_index, int frame_index, in
if (tile_part_length > max_tile_part_size) {
VerificationNote note{VerificationNote::Code::INVALID_JPEG2000_TILE_PART_SIZE};
note.set_frame(frame_index);
- note.set_frame_rate(frame_rate);
+ note.set_frame_rate(dcp::Fraction(frame_rate, 1));
note.set_component(tile_part_index);
note.set_size(tile_part_length);
notes.push_back(note);
@@ -368,7 +368,7 @@ dcp::verify_j2k(shared_ptr<const Data> j2k, int start_index, int frame_index, in
{
VerificationNote note({VerificationNote::Code::INVALID_JPEG2000_CODESTREAM, string(e.what())});
note.set_frame(start_index + frame_index);
- note.set_frame_rate(frame_rate);
+ note.set_frame_rate(dcp::Fraction(frame_rate, 1));
notes.push_back(note);
}
}