Check the hrtf config option earlier

This is to make sure it tries to find an HRTF-compatible format before reseting
the device, just like when using ALC_HRTF_SOFT.
This commit is contained in:
Chris Robinson
2014-02-23 20:00:52 -08:00
parent e6e3bdee83
commit ef8002a832
+8 -8
View File
@@ -1791,6 +1791,14 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const ALCint *attrList)
device->Frequency,
device->UpdateSize, device->NumUpdates);
if(device->Type != Loopback)
{
int nohrtf = !(device->Flags&DEVICE_HRTF_REQUEST);
if(GetConfigValueBool(NULL, "hrtf", !nohrtf))
device->Flags |= DEVICE_HRTF_REQUEST;
else
device->Flags &= ~DEVICE_HRTF_REQUEST;
}
if((device->Flags&DEVICE_HRTF_REQUEST))
{
enum DevFmtChannels chans;
@@ -1840,14 +1848,6 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const ALCint *attrList)
V(device->Synth,update)(device);
device->Hrtf = NULL;
if(device->Type != Loopback)
{
int nohrtf = !(device->Flags&DEVICE_HRTF_REQUEST);
if(GetConfigValueBool(NULL, "hrtf", !nohrtf))
device->Flags |= DEVICE_HRTF_REQUEST;
else
device->Flags &= ~DEVICE_HRTF_REQUEST;
}
if((device->Flags&DEVICE_HRTF_REQUEST))
{
device->Hrtf = GetHrtf(device);