From 79edd2cf3b46b22d3e6c57aec11b942809f24ff3 Mon Sep 17 00:00:00 2001 From: Chris Robinson <chris.kcat@gmail.com> Date: Sun, 6 Oct 2013 17:25:47 -0700 Subject: Use a macro for the silence threshold --- Alc/effects/reverb.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'Alc/effects/reverb.c') diff --git a/Alc/effects/reverb.c b/Alc/effects/reverb.c index 261a1f7f..4c65e0a6 100644 --- a/Alc/effects/reverb.c +++ b/Alc/effects/reverb.c @@ -575,11 +575,11 @@ static ALvoid ALreverbState_processStandard(ALreverbState *State, ALuint Samples for(c = 0;c < MaxChannels;c++) { ALfloat gain = State->Gain[c]; - if(gain > 0.00001f) - { - for(index = 0;index < SamplesToDo;index++) - SamplesOut[c][index] += gain * out[index][c&3]; - } + if(!(gain > GAIN_SILENCE_THRESHOLD)) + continue; + + for(index = 0;index < SamplesToDo;index++) + SamplesOut[c][index] += gain * out[index][c&3]; } } @@ -595,15 +595,16 @@ static ALvoid ALreverbState_processEax(ALreverbState *State, ALuint SamplesToDo, for(c = 0;c < MaxChannels;c++) { - ALfloat earlyGain = State->Early.PanGain[c]; - ALfloat lateGain = State->Late.PanGain[c]; + ALfloat earlyGain, lateGain; - if(earlyGain > 0.00001f) + earlyGain = State->Early.PanGain[c]; + if(earlyGain > GAIN_SILENCE_THRESHOLD) { for(index = 0;index < SamplesToDo;index++) SamplesOut[c][index] += earlyGain*early[index][c&3]; } - if(lateGain > 0.00001f) + lateGain = State->Late.PanGain[c]; + if(lateGain > GAIN_SILENCE_THRESHOLD) { for(index = 0;index < SamplesToDo;index++) SamplesOut[c][index] += lateGain*late[index][c&3]; -- cgit v1.2.3