aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/ALu.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2012-01-25 18:48:26 -0800
committerChris Robinson <[email protected]>2012-01-25 18:48:26 -0800
commitd807c4bf8778a1db47015c7b0ff32a8d02a84a8d (patch)
treea1b894d2d45ceefcc85ea8da1593191a8c3db1e7 /Alc/ALu.c
parent423f89c908f65f565180cdd9477d9ed67a329ffb (diff)
Don't process a default device slot if it doesn't exist
Diffstat (limited to 'Alc/ALu.c')
-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