aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Alc/ALc.c24
-rw-r--r--Alc/ALu.c21
-rw-r--r--OpenAL32/Include/alMain.h9
3 files changed, 24 insertions, 30 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index 83cd59f5..c50f0b25 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -1871,8 +1871,8 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const ALCint *attrList)
al_free(device->Dry.Buffer);
device->Dry.Buffer = NULL;
device->Dry.NumChannels = 0;
- device->VirtOut.Buffer = NULL;
- device->VirtOut.NumChannels = 0;
+ device->FOAOut.Buffer = NULL;
+ device->FOAOut.NumChannels = 0;
device->RealOut.Buffer = NULL;
device->RealOut.NumChannels = 0;
@@ -2012,15 +2012,11 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const ALCint *attrList)
if(device->Hrtf || device->Uhj_Encoder || device->AmbiDecoder)
{
- device->VirtOut.Buffer = device->Dry.Buffer;
- device->VirtOut.NumChannels = device->Dry.NumChannels;
device->RealOut.Buffer = device->Dry.Buffer + device->Dry.NumChannels;
device->RealOut.NumChannels = ChannelsFromDevFmt(device->FmtChans);
}
else
{
- device->VirtOut.Buffer = NULL;
- device->VirtOut.NumChannels = 0;
device->RealOut.Buffer = device->Dry.Buffer;
device->RealOut.NumChannels = device->Dry.NumChannels;
}
@@ -2180,8 +2176,8 @@ static ALCvoid FreeDevice(ALCdevice *device)
al_free(device->Dry.Buffer);
device->Dry.Buffer = NULL;
device->Dry.NumChannels = 0;
- device->VirtOut.Buffer = NULL;
- device->VirtOut.NumChannels = 0;
+ device->FOAOut.Buffer = NULL;
+ device->FOAOut.NumChannels = 0;
device->RealOut.Buffer = NULL;
device->RealOut.NumChannels = 0;
@@ -3365,8 +3361,8 @@ ALC_API ALCdevice* ALC_APIENTRY alcOpenDevice(const ALCchar *deviceName)
AL_STRING_INIT(device->DeviceName);
device->Dry.Buffer = NULL;
device->Dry.NumChannels = 0;
- device->VirtOut.Buffer = NULL;
- device->VirtOut.NumChannels = 0;
+ device->FOAOut.Buffer = NULL;
+ device->FOAOut.NumChannels = 0;
device->RealOut.Buffer = NULL;
device->RealOut.NumChannels = 0;
@@ -3629,8 +3625,8 @@ ALC_API ALCdevice* ALC_APIENTRY alcCaptureOpenDevice(const ALCchar *deviceName,
AL_STRING_INIT(device->DeviceName);
device->Dry.Buffer = NULL;
device->Dry.NumChannels = 0;
- device->VirtOut.Buffer = NULL;
- device->VirtOut.NumChannels = 0;
+ device->FOAOut.Buffer = NULL;
+ device->FOAOut.NumChannels = 0;
device->RealOut.Buffer = NULL;
device->RealOut.NumChannels = 0;
@@ -3825,8 +3821,8 @@ ALC_API ALCdevice* ALC_APIENTRY alcLoopbackOpenDeviceSOFT(const ALCchar *deviceN
AL_STRING_INIT(device->DeviceName);
device->Dry.Buffer = NULL;
device->Dry.NumChannels = 0;
- device->VirtOut.Buffer = NULL;
- device->VirtOut.NumChannels = 0;
+ device->FOAOut.Buffer = NULL;
+ device->FOAOut.NumChannels = 0;
device->RealOut.Buffer = NULL;
device->RealOut.NumChannels = 0;
diff --git a/Alc/ALu.c b/Alc/ALu.c
index 77852805..ac9057b7 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -1421,10 +1421,11 @@ ALvoid aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size)
while(size > 0)
{
SamplesToDo = minu(size, BUFFERSIZE);
- for(c = 0;c < device->VirtOut.NumChannels;c++)
- memset(device->VirtOut.Buffer[c], 0, SamplesToDo*sizeof(ALfloat));
- for(c = 0;c < device->RealOut.NumChannels;c++)
- memset(device->RealOut.Buffer[c], 0, SamplesToDo*sizeof(ALfloat));
+ for(c = 0;c < device->Dry.NumChannels;c++)
+ memset(device->Dry.Buffer[c], 0, SamplesToDo*sizeof(ALfloat));
+ if(device->Dry.Buffer != device->RealOut.Buffer)
+ for(c = 0;c < device->RealOut.NumChannels;c++)
+ memset(device->RealOut.Buffer[c], 0, SamplesToDo*sizeof(ALfloat));
if(device->Dry.Buffer != device->FOAOut.Buffer)
for(c = 0;c < device->FOAOut.NumChannels;c++)
memset(device->FOAOut.Buffer[c], 0, SamplesToDo*sizeof(ALfloat));
@@ -1508,12 +1509,12 @@ ALvoid aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size)
ALuint irsize = GetHrtfIrSize(device->Hrtf);
MixHrtfParams hrtfparams;
memset(&hrtfparams, 0, sizeof(hrtfparams));
- for(c = 0;c < device->VirtOut.NumChannels;c++)
+ for(c = 0;c < device->Dry.NumChannels;c++)
{
hrtfparams.Current = &device->Hrtf_Params[c];
hrtfparams.Target = &device->Hrtf_Params[c];
HrtfMix(device->RealOut.Buffer, lidx, ridx,
- device->VirtOut.Buffer[c], 0, device->Hrtf_Offset, 0,
+ device->Dry.Buffer[c], 0, device->Hrtf_Offset, 0,
irsize, &hrtfparams, &device->Hrtf_State[c], SamplesToDo
);
}
@@ -1522,14 +1523,14 @@ ALvoid aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size)
}
else if(device->AmbiDecoder)
{
- if(device->VirtOut.Buffer != device->FOAOut.Buffer)
+ if(device->Dry.Buffer != device->FOAOut.Buffer)
bformatdec_upSample(device->AmbiDecoder,
- device->VirtOut.Buffer, device->FOAOut.Buffer,
+ device->Dry.Buffer, device->FOAOut.Buffer,
device->FOAOut.NumChannels, SamplesToDo
);
bformatdec_process(device->AmbiDecoder,
device->RealOut.Buffer, device->RealOut.NumChannels,
- device->VirtOut.Buffer, SamplesToDo
+ device->Dry.Buffer, SamplesToDo
);
}
else
@@ -1543,7 +1544,7 @@ ALvoid aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size)
/* Encode to stereo-compatible 2-channel UHJ output. */
EncodeUhj2(device->Uhj_Encoder,
device->RealOut.Buffer[lidx], device->RealOut.Buffer[ridx],
- device->VirtOut.Buffer, SamplesToDo
+ device->Dry.Buffer, SamplesToDo
);
}
}
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h
index 99407fa8..532f7947 100644
--- a/OpenAL32/Include/alMain.h
+++ b/OpenAL32/Include/alMain.h
@@ -630,12 +630,9 @@ struct ALCdevice_struct
ALuint NumChannels;
} FOAOut;
- /* Virtual output, to be post-processed to the real output. */
- struct {
- ALfloat (*Buffer)[BUFFERSIZE];
- ALuint NumChannels;
- } VirtOut;
- /* "Real" output, which will be written to the device buffer. */
+ /* "Real" output, which will be written to the device buffer. May alias the
+ * dry buffer.
+ */
struct {
enum Channel ChannelName[MAX_OUTPUT_CHANNELS];