diff options
author | Chris Robinson <[email protected]> | 2017-07-13 21:30:05 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2017-07-13 21:44:25 -0700 |
commit | 22d77b87a3f103eeceec004cd9d053c17bf1b883 (patch) | |
tree | 3586ee67ee3800c4df97ebc93164271b7d122dc9 /Alc/ALu.c | |
parent | 67ab9ec4662a8d47a163426193eb962772aca23f (diff) |
Store the default effect slot in the context
Diffstat (limited to 'Alc/ALu.c')
-rw-r--r-- | Alc/ALu.c | 36 |
1 files changed, 18 insertions, 18 deletions
@@ -1030,7 +1030,7 @@ static void CalcNonAttnSourceParams(ALvoice *voice, const struct ALvoiceProps *p { SendSlots[i] = props->Send[i].Slot; if(!SendSlots[i] && i == 0) - SendSlots[i] = Device->DefaultSlot; + SendSlots[i] = ALContext->DefaultSlot; if(!SendSlots[i] || SendSlots[i]->Params.EffectType == AL_EFFECT_NULL) { SendSlots[i] = NULL; @@ -1100,7 +1100,7 @@ static void CalcAttnSourceParams(ALvoice *voice, const struct ALvoiceProps *prop { SendSlots[i] = props->Send[i].Slot; if(!SendSlots[i] && i == 0) - SendSlots[i] = Device->DefaultSlot; + SendSlots[i] = ALContext->DefaultSlot; if(!SendSlots[i] || SendSlots[i]->Params.EffectType == AL_EFFECT_NULL) { SendSlots[i] = NULL; @@ -1630,19 +1630,19 @@ void aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size) IncrementRef(&device->MixCount); - if(device->DefaultSlot != NULL) - { - ALeffectslot *slot = device->DefaultSlot; - CalcEffectSlotParams(slot, device); - for(c = 0;c < slot->NumChannels;c++) - memset(slot->WetBuffer[c], 0, SamplesToDo*sizeof(ALfloat)); - } - ctx = ATOMIC_LOAD(&device->ContextList, almemory_order_acquire); while(ctx) { const struct ALeffectslotArray *auxslots; + if(ctx->DefaultSlot != NULL) + { + ALeffectslot *slot = ctx->DefaultSlot; + CalcEffectSlotParams(slot, device); + for(c = 0;c < slot->NumChannels;c++) + memset(slot->WetBuffer[c], 0, SamplesToDo*sizeof(ALfloat)); + } + auxslots = ATOMIC_LOAD(&ctx->ActiveAuxSlots, almemory_order_acquire); UpdateContextSources(ctx, auxslots); @@ -1678,15 +1678,15 @@ void aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size) state->OutChannels); } - ctx = ctx->next; - } + if(ctx->DefaultSlot != NULL) + { + const ALeffectslot *slot = ctx->DefaultSlot; + ALeffectState *state = slot->Params.EffectState; + V(state,process)(SamplesToDo, slot->WetBuffer, state->OutBuffer, + state->OutChannels); + } - if(device->DefaultSlot != NULL) - { - const ALeffectslot *slot = device->DefaultSlot; - ALeffectState *state = slot->Params.EffectState; - V(state,process)(SamplesToDo, slot->WetBuffer, state->OutBuffer, - state->OutChannels); + ctx = ctx->next; } /* Increment the clock time. Every second's worth of samples is |