From 4a8151ae7a2669fabed85c9140d932481bdf4c9f Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 17 Apr 2018 22:04:39 +0100 Subject: [PATCH] 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. --- src/lib/video_content.cc | 4 ++-- 1 file 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 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()); } } -- 2.30.2