Fix calculation of recovery value now that divergence is recalculated afresh on each update

This commit is contained in:
Chris Cannam
2021-05-14 08:46:37 +01:00
parent d06b4efc16
commit 478d9233fe
5 changed files with 34 additions and 31 deletions

View File

@@ -189,6 +189,8 @@ RubberBandStretcher::Impl::consumeChannel(size_t c,
if (resampling) {
Profiler profiler2("RubberBandStretcher::Impl::resample");
toWrite = int(ceil(samples / m_pitchScale));
if (writable < toWrite) {
samples = int(floor(writable * m_pitchScale));
@@ -1077,6 +1079,8 @@ RubberBandStretcher::Impl::writeChunk(size_t channel, size_t shiftIncrement, boo
(m_pitchScale != 1.0 || m_options & OptionPitchHighConsistency) &&
cd.resampler) {
Profiler profiler2("RubberBandStretcher::Impl::resample");
size_t reqSize = int(ceil(si / m_pitchScale));
if (reqSize > cd.resamplebufSize) {
// This shouldn't normally happen -- the buffer is