aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/ALu.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2017-01-17 16:49:26 -0800
committerChris Robinson <[email protected]>2017-01-17 16:49:26 -0800
commitba0944af9ba8d851bc5b6ad99f314bbdac269716 (patch)
tree3031abd32f417c78b52476fccac0aa0ac6611996 /Alc/ALu.c
parentbfb7a6e4c85838bf2f6ed28fba452c55ad50c566 (diff)
Pass the left and right buffers to the hrtf mixers directly
Diffstat (limited to 'Alc/ALu.c')
-rw-r--r--Alc/ALu.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index 7022f792..02b4ffe8 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -1486,8 +1486,9 @@ ALvoid aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size)
if(device->Hrtf.Handle)
{
- int lidx = GetChannelIdxByName(device->RealOut, FrontLeft);
- int ridx = GetChannelIdxByName(device->RealOut, FrontRight);
+ HrtfDirectMixerFunc HrtfMix;
+ ALsizei irsize;
+ int lidx, ridx;
if(device->AmbiUp)
ambiup_process(device->AmbiUp,
@@ -1495,20 +1496,21 @@ ALvoid aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size)
SAFE_CONST(ALfloatBUFFERSIZE*,device->FOAOut.Buffer), SamplesToDo
);
- if(lidx != -1 && ridx != -1)
+ lidx = GetChannelIdxByName(device->RealOut, FrontLeft);
+ ridx = GetChannelIdxByName(device->RealOut, FrontRight);
+ assert(lidx != -1 && ridx != -1);
+
+ HrtfMix = SelectHrtfMixer();
+ irsize = device->Hrtf.IrSize;
+ for(c = 0;c < device->Dry.NumChannels;c++)
{
- HrtfDirectMixerFunc HrtfMix = SelectHrtfMixer();
- ALsizei irsize = device->Hrtf.IrSize;
- for(c = 0;c < device->Dry.NumChannels;c++)
- {
- HrtfMix(device->RealOut.Buffer, lidx, ridx,
- device->Dry.Buffer[c], device->Hrtf.Offset, irsize,
- device->Hrtf.Coeffs[c], device->Hrtf.Values[c],
- SamplesToDo
- );
- }
- device->Hrtf.Offset += SamplesToDo;
+ HrtfMix(device->RealOut.Buffer[lidx], device->RealOut.Buffer[ridx],
+ device->Dry.Buffer[c], device->Hrtf.Offset, irsize,
+ device->Hrtf.Coeffs[c], device->Hrtf.Values[c],
+ SamplesToDo
+ );
}
+ device->Hrtf.Offset += SamplesToDo;
}
else if(device->AmbiDecoder)
{