From 2fa3ae85c9a4050eab3a4f140fb6accd0a02ce85 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Wed, 27 Jan 2016 08:16:47 -0800 Subject: Pass a pointer to the input samples array for effect processing --- Alc/ALu.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'Alc/ALu.c') diff --git a/Alc/ALu.c b/Alc/ALu.c index 6a500833..2f1cdd85 100644 --- a/Alc/ALu.c +++ b/Alc/ALu.c @@ -1473,19 +1473,25 @@ ALvoid aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size) } /* effect slot processing */ -#define PROCESS_SLOT(iter) V((*iter)->EffectState,process)( \ - SamplesToDo, (*iter)->WetBuffer[0], device->DryBuffer, device->NumChannels \ -); - VECTOR_FOR_EACH(ALeffectslot*, ctx->ActiveAuxSlots, PROCESS_SLOT); -#undef PROCESS_SLOT + c = VECTOR_SIZE(ctx->ActiveAuxSlots); + for(i = 0;i < c;i++) + { + const ALeffectslot *slot = VECTOR_ELEM(ctx->ActiveAuxSlots, i); + ALeffectState *state = slot->EffectState; + V(state,process)(SamplesToDo, slot->WetBuffer, device->DryBuffer, + device->NumChannels); + } ctx = ctx->next; } - if((slot=device->DefaultSlot) != NULL) - V(slot->EffectState,process)( - SamplesToDo, slot->WetBuffer[0], device->DryBuffer, device->NumChannels - ); + if(device->DefaultSlot != NULL) + { + const ALeffectslot *slot = device->DefaultSlot; + ALeffectState *state = slot->EffectState; + V(state,process)(SamplesToDo, slot->WetBuffer, device->DryBuffer, + device->NumChannels); + } /* Increment the clock time. Every second's worth of samples is * converted and added to clock base so that large sample counts don't -- cgit v1.2.3