diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2007-10-12 02:11:14 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2007-10-12 02:11:14 +0000 |
commit | 40d8d9678552c17ff28d4f71411754013006dc45 (patch) | |
tree | 0b525192b9461245de8d3c763c3d9f8ed6f63398 /libs/ardour/audio_diskstream.cc | |
parent | 29f0d9732eb68fcaa22219cedddddd47bcaa8c17 (diff) |
fixes for varispeed playback, mackie control compilation, new odd color for treeview rows
git-svn-id: svn://localhost/ardour2/trunk@2544 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/audio_diskstream.cc')
-rw-r--r-- | libs/ardour/audio_diskstream.cc | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/libs/ardour/audio_diskstream.cc b/libs/ardour/audio_diskstream.cc index 7d95b78706..fbe12e6bf5 100644 --- a/libs/ardour/audio_diskstream.cc +++ b/libs/ardour/audio_diskstream.cc @@ -766,11 +766,18 @@ AudioDiskstream::process (nframes_t transport_frame, nframes_t nframes, nframes_ if (rec_nframes == 0 && _actual_speed != 1.0f && _actual_speed != -1.0f) { uint64_t phase = last_phase; + int64_t phi_delta; nframes_t i = 0; // Linearly interpolate into the alt buffer // using 40.24 fixp maths (swh) + if (phi != target_phi) { + phi_delta = ((int64_t)(target_phi - phi)) / nframes; + } else { + phi_delta = 0; + } + for (chan = c->begin(); chan != c->end(); ++chan) { float fr; @@ -785,19 +792,21 @@ AudioDiskstream::process (nframes_t transport_frame, nframes_t nframes, nframes_ chaninfo->speed_buffer[outsample] = chaninfo->current_playback_buffer[i] * (1.0f - fr) + chaninfo->current_playback_buffer[i+1] * fr; - phase += phi; + phase += phi + phi_delta; } chaninfo->current_playback_buffer = chaninfo->speed_buffer; } - playback_distance = i + 1; + playback_distance = i; // + 1; last_phase = (phase & 0xFFFFFF); } else { playback_distance = nframes; } + phi = target_phi; + } ret = 0; |