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
1 changed files with 7 additions and 6 deletions

View File

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