aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/ALc.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2016-03-09 22:57:38 -0800
committerChris Robinson <[email protected]>2016-03-09 22:57:38 -0800
commit3e2672ec9f5c2a84a0f871bd0379ee387f9a95ce (patch)
tree13df9f8f0823f55d4ee2759fd3314dc9b174634f /Alc/ALc.c
parent3b9fe27cbe466ecb2a1aad8013f2dc256d708aaa (diff)
Track the virtual and real output buffers ecplicitly
Diffstat (limited to 'Alc/ALc.c')
-rw-r--r--Alc/ALc.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index fd44ed28..fb9f2caa 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -1855,6 +1855,10 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const ALCint *attrList)
al_free(device->DryBuffer);
device->DryBuffer = NULL;
+ device->VirtOut.Buffer = NULL;
+ device->VirtOut.NumChannels = 0;
+ device->RealOut.Buffer = NULL;
+ device->RealOut.NumChannels = 0;
UpdateClockBase(device);
@@ -2124,6 +2128,21 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const ALCint *attrList)
return ALC_INVALID_DEVICE;
}
+ if(device->Hrtf || device->Uhj_Encoder)
+ {
+ device->VirtOut.Buffer = device->DryBuffer;
+ device->VirtOut.NumChannels = device->NumChannels;
+ device->RealOut.Buffer = device->DryBuffer + device->NumChannels;
+ device->RealOut.NumChannels = 2;
+ }
+ else
+ {
+ device->VirtOut.Buffer = NULL;
+ device->VirtOut.NumChannels = 0;
+ device->RealOut.Buffer = device->DryBuffer;
+ device->RealOut.NumChannels = device->NumChannels;
+ }
+
SetMixerFPUMode(&oldMode);
V0(device->Backend,lock)();
context = ATOMIC_LOAD(&device->ContextList);
@@ -2261,6 +2280,10 @@ static ALCvoid FreeDevice(ALCdevice *device)
al_free(device->DryBuffer);
device->DryBuffer = NULL;
+ device->VirtOut.Buffer = NULL;
+ device->VirtOut.NumChannels = 0;
+ device->RealOut.Buffer = NULL;
+ device->RealOut.NumChannels = 0;
al_free(device);
}
@@ -3361,6 +3384,10 @@ ALC_API ALCdevice* ALC_APIENTRY alcOpenDevice(const ALCchar *deviceName)
device->Render_Mode = NormalRender;
AL_STRING_INIT(device->DeviceName);
device->DryBuffer = NULL;
+ device->VirtOut.Buffer = NULL;
+ device->VirtOut.NumChannels = 0;
+ device->RealOut.Buffer = NULL;
+ device->RealOut.NumChannels = 0;
ATOMIC_INIT(&device->ContextList, NULL);
@@ -3616,6 +3643,10 @@ ALC_API ALCdevice* ALC_APIENTRY alcCaptureOpenDevice(const ALCchar *deviceName,
AL_STRING_INIT(device->DeviceName);
device->DryBuffer = NULL;
+ device->VirtOut.Buffer = NULL;
+ device->VirtOut.NumChannels = 0;
+ device->RealOut.Buffer = NULL;
+ device->RealOut.NumChannels = 0;
InitUIntMap(&device->BufferMap, ~0);
InitUIntMap(&device->EffectMap, ~0);
@@ -3806,6 +3837,10 @@ ALC_API ALCdevice* ALC_APIENTRY alcLoopbackOpenDeviceSOFT(const ALCchar *deviceN
device->Render_Mode = NormalRender;
AL_STRING_INIT(device->DeviceName);
device->DryBuffer = NULL;
+ device->VirtOut.Buffer = NULL;
+ device->VirtOut.NumChannels = 0;
+ device->RealOut.Buffer = NULL;
+ device->RealOut.NumChannels = 0;
ATOMIC_INIT(&device->ContextList, NULL);