From 3fdee6c814d51bc0d78a0be8bc68d4803e51c702 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Fri, 28 Aug 2020 23:08:44 -0700 Subject: [PATCH] Calculate the correct number of convolution segments --- alc/effects/convolution.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alc/effects/convolution.cpp b/alc/effects/convolution.cpp index 68becf49..9d8f9767 100644 --- a/alc/effects/convolution.cpp +++ b/alc/effects/convolution.cpp @@ -223,7 +223,7 @@ EffectBufferBase *ConvolutionState::createBuffer(const ALCdevice *device, /* Calculate the number of segments needed to hold the impulse response and * the input history (rounded up), and allocate them. */ - filter->mNumConvolveSegs = (buffer.mSampleLen+(ConvolveUpdateSamples-1)) / + filter->mNumConvolveSegs = (resampledCount+(ConvolveUpdateSamples-1)) / ConvolveUpdateSamples; const size_t complex_length{filter->mNumConvolveSegs * m * (numChannels+1)};