Add the default auxiliary slot to the active slot array

This commit is contained in:
Chris Robinson
2017-07-13 23:13:02 -07:00
parent 249afde5f9
commit 8fa3f6da64
2 changed files with 11 additions and 18 deletions
+11 -2
View File
@@ -2549,8 +2549,17 @@ static ALvoid InitContext(ALCcontext *Context)
InitUIntMap(&Context->SourceMap, Context->Device->SourcesMax);
InitUIntMap(&Context->EffectSlotMap, Context->Device->AuxiliaryEffectSlotMax);
auxslots = al_calloc(DEF_ALIGN, sizeof(struct ALeffectslotArray));
auxslots->count = 0;
if(Context->DefaultSlot)
{
auxslots = al_calloc(DEF_ALIGN, FAM_SIZE(struct ALeffectslotArray, slot, 1));
auxslots->count = 1;
auxslots->slot[0] = Context->DefaultSlot;
}
else
{
auxslots = al_calloc(DEF_ALIGN, sizeof(struct ALeffectslotArray));
auxslots->count = 0;
}
ATOMIC_INIT(&Context->ActiveAuxSlots, auxslots);
//Set globals
-16
View File
@@ -1633,14 +1633,6 @@ void aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size)
{
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);
@@ -1676,14 +1668,6 @@ void aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size)
state->OutChannels);
}
if(ctx->DefaultSlot != NULL)
{
const ALeffectslot *slot = ctx->DefaultSlot;
ALeffectState *state = slot->Params.EffectState;
V(state,process)(SamplesToDo, slot->WetBuffer, state->OutBuffer,
state->OutChannels);
}
ctx = ctx->next;
}