summaryrefslogtreecommitdiff
path: root/src/lib/ffmpeg_content.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2024-12-22 00:09:57 +0100
committerCarl Hetherington <cth@carlh.net>2025-09-02 22:40:13 +0200
commit33b0928b20618da5bc295711bfdf3d638863afa5 (patch)
tree24af21c6a7b863d914991ae837c36b6b9b50bcce /src/lib/ffmpeg_content.cc
parent6784eb8de2451afd2dedc15c05eac043011b5afb (diff)
Untested conversion to num/den DCPTime.arbitrary-hz
Summary of required changes: Replace ::from_frames with a constructor that takes num/den. Provide and use member to_debug_string() instead of to_string(). Provide and use member to_serializable_string() and string constructor instead of fmt::to_string on .get() and number constructor. Provide and use content_time() member instead of ContentTime constructor from DCPTime. Use frames_round(96000) instead of get() when comparing times to see if they are "close enough". Provide and use DCPTime(x, FrameRateChange) constructor when converting from ContentTime. Use .seconds() when calculating proportions or sometimes when dividing by HZ. Provide and use operator bool(). Pass explicit 96000 denominator in a lot of places. Add member max() and use it instead of static max() Change BOOST_CHECK_EQUAL to BOOST_CHECK Provide operator/ and use it instead of .get() / 2.
Diffstat (limited to 'src/lib/ffmpeg_content.cc')
-rw-r--r--src/lib/ffmpeg_content.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/ffmpeg_content.cc b/src/lib/ffmpeg_content.cc
index 6261c4003..7c3431ffe 100644
--- a/src/lib/ffmpeg_content.cc
+++ b/src/lib/ffmpeg_content.cc
@@ -416,13 +416,13 @@ FFmpegContent::full_length (shared_ptr<const Film> film) const
{
FrameRateChange const frc (film, shared_from_this());
if (video) {
- return DCPTime::from_frames (llrint (video->length_after_3d_combine() * frc.factor()), film->video_frame_rate());
+ return DCPTime(llrint(video->length_after_3d_combine() * frc.factor()), film->video_frame_rate());
}
if (audio) {
DCPTime longest;
for (auto i: audio->streams()) {
- longest = max (longest, DCPTime::from_frames(llrint(i->length() / frc.speed_up), i->frame_rate()));
+ longest = max(longest, DCPTime(llrint(i->length() / frc.speed_up), i->frame_rate()));
}
return longest;
}
@@ -437,7 +437,7 @@ DCPTime
FFmpegContent::approximate_length () const
{
if (video) {
- return DCPTime::from_frames (video->length_after_3d_combine(), 24);
+ return DCPTime(video->length_after_3d_combine(), 24);
}
DCPOMATIC_ASSERT (audio);
@@ -447,7 +447,7 @@ FFmpegContent::approximate_length () const
longest = max (longest, Frame(llrint(i->length())));
}
- return DCPTime::from_frames (longest, 24);
+ return DCPTime(longest, 24);
}