diff options
author | Chris Robinson <[email protected]> | 2019-05-31 11:58:48 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-05-31 11:58:48 -0700 |
commit | 20ce461096c88e1bafa209a43541a599ff0ad610 (patch) | |
tree | 982eddfd4587ac44bdd9052ed677e6bc2521a5f8 /Alc | |
parent | 6ee49cad522b5bd12d954c508bae977e3c98cb07 (diff) |
Make sure the T60 filter gains are properly clamped
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/effects/reverb.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Alc/effects/reverb.cpp b/Alc/effects/reverb.cpp index 51c0c467..54151d6e 100644 --- a/Alc/effects/reverb.cpp +++ b/Alc/effects/reverb.cpp @@ -699,15 +699,15 @@ void T60Filter::calcCoeffs(const ALfloat length, const ALfloat lfDecayTime, const ALfloat mfDecayTime, const ALfloat hfDecayTime, const ALfloat lf0norm, const ALfloat hf0norm) { - const ALfloat lfGain{CalcDecayCoeff(length, lfDecayTime)}; const ALfloat mfGain{CalcDecayCoeff(length, mfDecayTime)}; - const ALfloat hfGain{CalcDecayCoeff(length, hfDecayTime)}; + const ALfloat lfGain{maxf(CalcDecayCoeff(length, lfDecayTime)/mfGain, 0.001f)}; + const ALfloat hfGain{maxf(CalcDecayCoeff(length, hfDecayTime)/mfGain, 0.001f)}; MidGain[1] = mfGain; - LFFilter.setParams(BiquadType::LowShelf, lfGain/mfGain, lf0norm, - LFFilter.rcpQFromSlope(lfGain/mfGain, 1.0f)); - HFFilter.setParams(BiquadType::HighShelf, hfGain/mfGain, hf0norm, - HFFilter.rcpQFromSlope(hfGain/mfGain, 1.0f)); + LFFilter.setParams(BiquadType::LowShelf, lfGain, lf0norm, + LFFilter.rcpQFromSlope(lfGain, 1.0f)); + HFFilter.setParams(BiquadType::HighShelf, hfGain, hf0norm, + HFFilter.rcpQFromSlope(hfGain, 1.0f)); } /* Update the early reflection line lengths and gain coefficients. */ |