aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2012-09-16 08:42:36 -0700
committerChris Robinson <[email protected]>2012-09-16 08:42:36 -0700
commitc19d9d34528c054083cd8fda1ecf5ed8673df0c9 (patch)
tree8ab4e38bd8243598879bd03e1168baed22723a75 /Alc
parent79b6d89b3f3f49649e349d8bac1a9bb42ec3f1de (diff)
Don't try to correct for non-existing clicks.
Diffstat (limited to 'Alc')
-rw-r--r--Alc/ALu.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index 2aa5bf55..f2de82e2 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -993,12 +993,15 @@ ALvoid aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size)
* generated. Delays caused by effects and HRTF aren't caught. */
if(device->FmtChans == DevFmtMono)
{
- for(i = 0;i < SamplesToDo;i++)
+ ALfloat offset = device->ClickRemoval[FrontCenter];
+ if(offset < (1.0f/32768.0f))
+ offset = 0.0f;
+ else for(i = 0;i < SamplesToDo;i++)
{
- device->DryBuffer[FrontCenter][i] += device->ClickRemoval[FrontCenter];
- device->ClickRemoval[FrontCenter] -= device->ClickRemoval[FrontCenter] * (1.0f/256.0f);
+ device->DryBuffer[FrontCenter][i] += offset;
+ offset -= offset * (1.0f/256.0f);
}
- device->ClickRemoval[FrontCenter] += device->PendingClicks[FrontCenter];
+ device->ClickRemoval[FrontCenter] = offset + device->PendingClicks[FrontCenter];
device->PendingClicks[FrontCenter] = 0.0f;
}
else if(device->FmtChans == DevFmtStereo)
@@ -1007,7 +1010,9 @@ ALvoid aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size)
for(c = 0;c < 2;c++)
{
ALfloat offset = device->ClickRemoval[c];
- for(i = 0;i < SamplesToDo;i++)
+ if(offset < (1.0f/32768.0f))
+ offset = 0.0f;
+ else for(i = 0;i < SamplesToDo;i++)
{
device->DryBuffer[c][i] += offset;
offset -= offset * (1.0f/256.0f);
@@ -1033,7 +1038,9 @@ ALvoid aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size)
for(c = 0;c < MaxChannels;c++)
{
ALfloat offset = device->ClickRemoval[c];
- for(i = 0;i < SamplesToDo;i++)
+ if(offset < (1.0f/32768.0f))
+ offset = 0.0f;
+ else for(i = 0;i < SamplesToDo;i++)
{
device->DryBuffer[c][i] += offset;
offset -= offset * (1.0f/256.0f);