summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-04-17 22:04:39 +0100
committerCarl Hetherington <cth@carlh.net>2018-04-17 22:04:39 +0100
commit4a8151ae7a2669fabed85c9140d932481bdf4c9f (patch)
treef64181a13ef27b7fd39208f03508879e703c20cd /src/lib
parentf46a52979f3ab49403408127141d3fed52bedbc7 (diff)
Use round rather than ceil when putting positions and start trims
onto frame boundaries. ceil() can creep upwards with rounding error, which I have seen happen over a save/load.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/video_content.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/video_content.cc b/src/lib/video_content.cc
index f78dab17e..d3ba6c1ab 100644
--- a/src/lib/video_content.cc
+++ b/src/lib/video_content.cc
@@ -549,13 +549,13 @@ VideoContent::take_settings_from (shared_ptr<const VideoContent> c)
void
VideoContent::modify_position (DCPTime& pos) const
{
- pos = pos.ceil (_parent->film()->video_frame_rate());
+ pos = pos.round (_parent->film()->video_frame_rate());
}
void
VideoContent::modify_trim_start (ContentTime& trim) const
{
if (_parent->video_frame_rate()) {
- trim = trim.ceil (_parent->video_frame_rate().get());
+ trim = trim.round (_parent->video_frame_rate().get());
}
}