aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Alc/ALc.c12
-rw-r--r--OpenAL32/Include/alMain.h3
2 files changed, 11 insertions, 4 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index 0bf73b13..de722d77 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -1186,7 +1186,11 @@ static ALCboolean UpdateDeviceParams(ALCdevice *device, const ALCint *attrList)
ProcessContext(context);
}
- if(device->Bs2bLevel > 0 && device->Bs2bLevel <= 6)
+ device->UseHRTF = AL_FALSE;
+ if(ChannelsFromDevFmt(device->FmtChans) == 2 && device->Frequency == 44100)
+ device->UseHRTF = GetConfigValueBool(NULL, "hrtf", AL_FALSE);
+
+ if(!device->UseHRTF && device->Bs2bLevel > 0 && device->Bs2bLevel <= 6)
{
if(!device->Bs2b)
{
@@ -1202,14 +1206,13 @@ static ALCboolean UpdateDeviceParams(ALCdevice *device, const ALCint *attrList)
device->Bs2b = NULL;
}
- if(ChannelsFromDevFmt(device->FmtChans) <= 2)
+ device->HeadDampen = 0.0f;
+ if(!device->UseHRTF && ChannelsFromDevFmt(device->FmtChans) <= 2)
{
device->HeadDampen = GetConfigValueFloat(NULL, "head_dampen", DEFAULT_HEAD_DAMPEN);
device->HeadDampen = __min(device->HeadDampen, 1.0f);
device->HeadDampen = __max(device->HeadDampen, 0.0f);
}
- else
- device->HeadDampen = 0.0f;
return ALC_TRUE;
}
@@ -2279,6 +2282,7 @@ ALC_API ALCdevice* ALC_APIENTRY alcOpenDevice(const ALCchar *deviceName)
device->IsLoopbackDevice = AL_FALSE;
device->LastError = ALC_NO_ERROR;
+ device->UseHRTF = AL_FALSE;
device->Bs2b = NULL;
device->szDeviceName = NULL;
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h
index c6a1c4ba..24027c99 100644
--- a/OpenAL32/Include/alMain.h
+++ b/OpenAL32/Include/alMain.h
@@ -478,6 +478,9 @@ struct ALCdevice_struct
// Duplicate stereo sources on the side/rear channels
ALboolean DuplicateStereo;
+ // Use HRTF filters for mixing sounds
+ ALboolean UseHRTF;
+
// Dry path buffer mix
ALfloat DryBuffer[BUFFERSIZE][MAXCHANNELS];