aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/ALc.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2017-04-05 11:29:58 -0700
committerChris Robinson <[email protected]>2017-04-05 11:29:58 -0700
commitf76dea0c0321ebcc0f5a8838f1826309463cd2c1 (patch)
treee024ff6d69d45baae9dc733515799f443066dc49 /Alc/ALc.c
parente7ca61e8b585d1546cb92ddcf0cfcd1fe084484c (diff)
Store the loaded hrtf entry container in the enumerated hrtf entry
Diffstat (limited to 'Alc/ALc.c')
-rw-r--r--Alc/ALc.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index f248a998..d154e240 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -2056,11 +2056,11 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const ALCint *attrList)
}
if(VECTOR_SIZE(device->HrtfList) > 0)
{
- device->FmtChans = DevFmtStereo;
+ const struct Hrtf *hrtf = VECTOR_ELEM(device->HrtfList, 0).hrtf->handle;
if(hrtf_id >= 0 && (size_t)hrtf_id < VECTOR_SIZE(device->HrtfList))
- device->Frequency = VECTOR_ELEM(device->HrtfList, hrtf_id).hrtf->sampleRate;
- else
- device->Frequency = VECTOR_ELEM(device->HrtfList, 0).hrtf->sampleRate;
+ hrtf = VECTOR_ELEM(device->HrtfList, hrtf_id).hrtf->handle;
+ device->FmtChans = DevFmtStereo;
+ device->Frequency = hrtf->sampleRate;
device->Flags |= DEVICE_CHANNELS_REQUEST | DEVICE_FREQUENCY_REQUEST;
}
else
@@ -2088,7 +2088,7 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const ALCint *attrList)
}
for(i = 0;i < VECTOR_SIZE(device->HrtfList);i++)
{
- const struct Hrtf *hrtf = VECTOR_ELEM(device->HrtfList, i).hrtf;
+ const struct Hrtf *hrtf = VECTOR_ELEM(device->HrtfList, i).hrtf->handle;
if(hrtf->sampleRate == device->Frequency)
break;
}