From 93b13251fa3b2f5db81d6ea1c50c58333dc376a6 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Tue, 23 Oct 2012 17:10:25 +0000 Subject: fix backwards playback position calculation git-svn-id: svn://localhost/ardour2/branches/3.0@13322 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/session_process.cc | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/libs/ardour/session_process.cc b/libs/ardour/session_process.cc index bd386a943d..33207a3491 100644 --- a/libs/ardour/session_process.cc +++ b/libs/ardour/session_process.cc @@ -341,8 +341,8 @@ Session::process_with_events (pframes_t nframes) if (_transport_speed == 1.0) { frames_moved = (framecnt_t) nframes; } else { - interpolation.set_target_speed (fabs(_target_transport_speed)); - interpolation.set_speed (fabs(_transport_speed)); + interpolation.set_target_speed (_target_transport_speed); + interpolation.set_speed (_transport_speed); frames_moved = (framecnt_t) interpolation.interpolate (0, nframes, 0, 0); } @@ -813,8 +813,8 @@ Session::process_without_events (pframes_t nframes) if (_transport_speed == 1.0) { frames_moved = (framecnt_t) nframes; } else { - interpolation.set_target_speed (fabs(_target_transport_speed)); - interpolation.set_speed (fabs(_transport_speed)); + interpolation.set_target_speed (_target_transport_speed); + interpolation.set_speed (_transport_speed); frames_moved = (framecnt_t) interpolation.interpolate (0, nframes, 0, 0); } @@ -848,16 +848,6 @@ Session::process_without_events (pframes_t nframes) get_track_statistics (); - /* XXX: I'm not sure whether this is correct, but at least it - matches process_with_events, so that this new frames_moved - is -ve when transport speed is -ve. This means that the - transport position is updated correctly when we are in - reverse. It seems a bit wrong that we're not using the - interpolator to compute this. - */ - - frames_moved = (framecnt_t) floor (_transport_speed * nframes); - if (frames_moved < 0) { decrement_transport_position (-frames_moved); } else { -- cgit v1.2.3