aboutsummaryrefslogtreecommitdiffstats
path: root/alc/effects/reverb.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2023-11-22 07:28:50 -0800
committerChris Robinson <[email protected]>2023-11-22 07:28:50 -0800
commit403aaa4fdd0ddca725cb06560dda99f8766e0750 (patch)
treeb0b2e01351664be73f706738178ee25cf725c688 /alc/effects/reverb.cpp
parent62c5b38c811ac1552a1cadb00604477ebb39c646 (diff)
Compensate the late delay tap by the early delay buffer
Diffstat (limited to 'alc/effects/reverb.cpp')
-rw-r--r--alc/effects/reverb.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/alc/effects/reverb.cpp b/alc/effects/reverb.cpp
index 5068c8d7..1af50559 100644
--- a/alc/effects/reverb.cpp
+++ b/alc/effects/reverb.cpp
@@ -1018,8 +1018,12 @@ void ReverbPipeline::updateDelayLine(const float earlyDelay, const float lateDel
mEarlyDelayTap[i][1] = float2uint((earlyDelay+length) * frequency);
mEarlyDelayCoeff[i] = CalcDecayCoeff(length, decayTime);
+ /* Reduce the late delay tap by the shortest early delay line length to
+ * compensate for the late line input being fed by the delayed early
+ * output.
+ */
length = (LATE_LINE_LENGTHS[i] - LATE_LINE_LENGTHS.front())/float{NUM_LINES}*density_mult +
- lateDelay;
+ std::max(lateDelay - EARLY_LINE_LENGTHS[0]*density_mult, 0.0f);
mLateDelayTap[i][1] = float2uint(length * frequency);
}
}