summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2013-08-04 18:49:28 +0200
committerRobin Gareus <robin@gareus.org>2013-08-04 18:49:28 +0200
commit00b694fd795962d9229c1c8aac13c0b66a16c1e4 (patch)
tree8c49984fac0f17fac4a38c8d1b201be483794649 /gtk2_ardour
parent68fc5bbf6c4c8cf4d60c77b02f28268b0b4b90c5 (diff)
fix rounding issue when dragging video with fractional fps
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/editor_drag.cc2
-rw-r--r--gtk2_ardour/video_timeline.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc
index 35828830b0..b083e851c5 100644
--- a/gtk2_ardour/editor_drag.cc
+++ b/gtk2_ardour/editor_drag.cc
@@ -1665,7 +1665,7 @@ VideoTimeLineDrag::motion (GdkEvent* event, bool first_move)
}
framecnt_t dt = adjusted_current_frame (event) - raw_grab_frame() + _pointer_frame_offset;
- dt = ARDOUR_UI::instance()->video_timeline->quantify_frames_to_apv(dt);
+ dt = ARDOUR_UI::instance()->video_timeline->quantify_frames_to_apv(_startdrag_video_offset+dt) - _startdrag_video_offset;
if (_max_backwards_drag >= 0 && dt <= - _max_backwards_drag) {
dt = - _max_backwards_drag;
diff --git a/gtk2_ardour/video_timeline.h b/gtk2_ardour/video_timeline.h
index fbf563ecf8..c96c9b1320 100644
--- a/gtk2_ardour/video_timeline.h
+++ b/gtk2_ardour/video_timeline.h
@@ -96,7 +96,7 @@ class VideoTimeLine : public sigc::trackable, public ARDOUR::SessionHandlePtr, p
float get_apv(); /* audio frames per video frame; */
ARDOUR::framecnt_t get_duration () { return video_duration;}
ARDOUR::frameoffset_t get_offset () { return video_offset;}
- ARDOUR::frameoffset_t quantify_frames_to_apv (ARDOUR::frameoffset_t offset) { return floor(offset/get_apv())*get_apv(); }
+ ARDOUR::frameoffset_t quantify_frames_to_apv (ARDOUR::frameoffset_t offset) { return rint(offset/get_apv())*get_apv(); }
void set_offset (ARDOUR::frameoffset_t offset) { video_offset = quantify_frames_to_apv(offset); } // this function does not update video_offset_p, call save_undo() to finalize changes to this! - this fn is currently only used from editor_drag.cc
protected: