aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/ALu.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2017-07-13 21:30:05 -0700
committerChris Robinson <[email protected]>2017-07-13 21:44:25 -0700
commit22d77b87a3f103eeceec004cd9d053c17bf1b883 (patch)
tree3586ee67ee3800c4df97ebc93164271b7d122dc9 /Alc/ALu.c
parent67ab9ec4662a8d47a163426193eb962772aca23f (diff)
Store the default effect slot in the context
Diffstat (limited to 'Alc/ALu.c')
-rw-r--r--Alc/ALu.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index 35b1061e..e44c6c2c 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -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