aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
Diffstat (limited to 'Alc')
-rw-r--r--Alc/ALu.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index 96a46aeb..62cc36c4 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -989,22 +989,25 @@ ALvoid aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size)
}
slot = &device->DefaultSlot;
- for(c = 0;c < SamplesToDo;c++)
+ if(*slot != NULL)
{
- (*slot)->WetBuffer[c] += (*slot)->ClickRemoval[0];
- (*slot)->ClickRemoval[0] -= (*slot)->ClickRemoval[0] * (1.0f/256.0f);
- }
- (*slot)->ClickRemoval[0] += (*slot)->PendingClicks[0];
- (*slot)->PendingClicks[0] = 0.0f;
+ for(c = 0;c < SamplesToDo;c++)
+ {
+ (*slot)->WetBuffer[c] += (*slot)->ClickRemoval[0];
+ (*slot)->ClickRemoval[0] -= (*slot)->ClickRemoval[0] * (1.0f/256.0f);
+ }
+ (*slot)->ClickRemoval[0] += (*slot)->PendingClicks[0];
+ (*slot)->PendingClicks[0] = 0.0f;
- if(ExchangeInt(&(*slot)->NeedsUpdate, AL_FALSE))
- ALeffectState_Update((*slot)->EffectState, ctx, *slot);
+ if(ExchangeInt(&(*slot)->NeedsUpdate, AL_FALSE))
+ ALeffectState_Update((*slot)->EffectState, ctx, *slot);
- ALeffectState_Process((*slot)->EffectState, SamplesToDo,
- (*slot)->WetBuffer, device->DryBuffer);
+ ALeffectState_Process((*slot)->EffectState, SamplesToDo,
+ (*slot)->WetBuffer, device->DryBuffer);
- for(i = 0;i < SamplesToDo;i++)
- (*slot)->WetBuffer[i] = 0.0f;
+ for(i = 0;i < SamplesToDo;i++)
+ (*slot)->WetBuffer[i] = 0.0f;
+ }
UnlockDevice(device);
//Post processing loop