From a8cf2aa4f95f1b6c81b5d1e970623c8cfcf0c584 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Wed, 7 Nov 2012 03:17:55 +0000 Subject: [PATCH] fix required-sample count for cubic interpolation. I have not proved if the iterative process in CubicInterpolation::interpolate() is identical to (nframes * fabs(_actual_speed)), however ceil() of it is empirically always larger. Also, the cubic interpolation needs +2 samples. Ardour3: Too close to call :) git-svn-id: svn://localhost/ardour2/branches/3.0@13392 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/audio_diskstream.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/ardour/audio_diskstream.cc b/libs/ardour/audio_diskstream.cc index 3345a00b42..2d2d3d252f 100644 --- a/libs/ardour/audio_diskstream.cc +++ b/libs/ardour/audio_diskstream.cc @@ -578,7 +578,7 @@ AudioDiskstream::process (framepos_t transport_frame, pframes_t nframes, framecn /* no varispeed playback if we're recording, because the output .... TBD */ if (rec_nframes == 0 && _actual_speed != 1.0f) { - necessary_samples = (framecnt_t) floor ((nframes * fabs (_actual_speed))) + 1; + necessary_samples = (framecnt_t) ceil ((nframes * fabs (_actual_speed))) + 2; } else { necessary_samples = nframes; }