diff options
author | Chris Robinson <[email protected]> | 2012-01-25 18:48:26 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2012-01-25 18:48:26 -0800 |
commit | d807c4bf8778a1db47015c7b0ff32a8d02a84a8d (patch) | |
tree | a1b894d2d45ceefcc85ea8da1593191a8c3db1e7 /Alc/ALu.c | |
parent | 423f89c908f65f565180cdd9477d9ed67a329ffb (diff) |
Don't process a default device slot if it doesn't exist
Diffstat (limited to 'Alc/ALu.c')
-rw-r--r-- | Alc/ALu.c | 27 |
1 files changed, 15 insertions, 12 deletions
@@ -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 |