aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/hrtf.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2011-07-19 00:43:31 -0700
committerChris Robinson <[email protected]>2011-07-19 00:43:31 -0700
commit244d60fb961336280895413a0c6881388fba9877 (patch)
tree45a42b325fa846b7743862d6b9fcfa327442c29e /Alc/hrtf.c
parent0ae9638aa58f160a51340ced1812fdafb3b80969 (diff)
Slightly improve the gain change delta calculation
Diffstat (limited to 'Alc/hrtf.c')
-rw-r--r--Alc/hrtf.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Alc/hrtf.c b/Alc/hrtf.c
index 1f408236..a88c37e5 100644
--- a/Alc/hrtf.c
+++ b/Alc/hrtf.c
@@ -89,8 +89,9 @@ ALfloat CalcHrtfDelta(ALfloat oldGain, ALfloat newGain, const ALfloat olddir[3],
ALfloat gainChange, angleChange, delta;
// Calculate the normalized dB gain change.
- gainChange = aluFabs((log10(__max(newGain, 0.0001f)) -
- log10(__max(oldGain, 0.0001f))) / log10(0.0001f));
+ newGain = __max(newGain, 0.0001f);
+ oldGain = __max(oldGain, 0.0001f);
+ gainChange = aluFabs(log10(newGain / oldGain) / log10(0.0001f));
// Calculate the normalized listener to source angle change when there is
// enough gain to notice it.