aboutsummaryrefslogtreecommitdiffstats
path: root/alc/mixer
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2020-05-30 16:29:23 -0700
committerChris Robinson <[email protected]>2020-05-30 16:29:23 -0700
commit70d345bbf20186f6765442060f02db531a5ad7a7 (patch)
tree9ed2e50be1fc2aaf174fcd4e8ced5bf80cb79fd6 /alc/mixer
parent7a95a870be6d9f02480562db8f1b3315b9b4776d (diff)
Avoid convolving an always-0 sample
Diffstat (limited to 'alc/mixer')
-rw-r--r--alc/mixer/hrtfbase.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/alc/mixer/hrtfbase.h b/alc/mixer/hrtfbase.h
index e8850447..f0995fec 100644
--- a/alc/mixer/hrtfbase.h
+++ b/alc/mixer/hrtfbase.h
@@ -66,10 +66,10 @@ inline void MixHrtfBlendBase(const float *InSamples, float2 *RESTRICT AccumSampl
if LIKELY(newGainStep*static_cast<float>(BufferSize) > GAIN_SILENCE_THRESHOLD)
{
- size_t ldelay{HRTF_HISTORY_LENGTH - newparams->Delay[0]};
- size_t rdelay{HRTF_HISTORY_LENGTH - newparams->Delay[1]};
- float stepcount{0.0f};
- for(size_t i{0u};i < BufferSize;++i)
+ size_t ldelay{HRTF_HISTORY_LENGTH+1 - newparams->Delay[0]};
+ size_t rdelay{HRTF_HISTORY_LENGTH+1 - newparams->Delay[1]};
+ float stepcount{1.0f};
+ for(size_t i{1u};i < BufferSize;++i)
{
const float g{newGainStep*stepcount};
const float left{InSamples[ldelay++] * g};