13
0

fix vari-speed phase (when used for calculation only)

and clarify an old comment.
This commit is contained in:
Robin Gareus 2013-08-27 20:55:15 +02:00
parent 1d972d05c5
commit 4864833669

View File

@ -135,17 +135,18 @@ CubicInterpolation::interpolate (int channel, framecnt_t nframes, Sample *input,
inm1 = input[i]; inm1 = input[i];
} }
i = floor(distance);
phase[channel] = distance - floor(distance);
} else { } else {
/* used to calculate play-distance with acceleration (silent roll)
/* not sure that this is ever utilized - it implies that one of the input/output buffers is missing */ * (use same algorithm as real playback for identical rounding/floor'ing)
*/
for (framecnt_t outsample = 0; outsample < nframes; ++outsample) { for (framecnt_t outsample = 0; outsample < nframes; ++outsample) {
distance += _speed + acceleration; distance += _speed + acceleration;
} }
i = floor(distance);
} }
i = floor(distance);
phase[channel] = distance - floor(distance);
return i; return i;
} }