Maintain frame-snap for position and trim when set_video_frame_rate is called (#1335).
[dcpomatic.git] / src / lib / content.cc
index f2380653f661d54131e50194f42522742f07a562..2e4e77f8d6e6fcbcd3f5eb65bb0f99eab5aed818 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2013-2016 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2013-2018 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -360,6 +360,12 @@ Content::set_video_frame_rate (double r)
        }
 
        signal_changed (ContentProperty::VIDEO_FRAME_RATE);
+
+       /* Make sure things are still on frame boundaries */
+       if (video) {
+               set_position (position());
+               set_trim_start (trim_start());
+       }
 }
 
 void