diff options
author | Chris Robinson <[email protected]> | 2017-04-05 12:27:30 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2017-04-05 12:27:30 -0700 |
commit | 2eaa10fc213dd60b197129da17b431b3d7e9f1d5 (patch) | |
tree | 21795210b08e9d29b5afff3fcfe557e58b079f05 /Alc/panning.c | |
parent | f76dea0c0321ebcc0f5a8838f1826309463cd2c1 (diff) |
Load HRTF files as needed
Currently only applies to external files, rather than embedded datasets. Also,
HRTFs aren't unloaded after being loaded, until library shutdown.
Diffstat (limited to 'Alc/panning.c')
-rw-r--r-- | Alc/panning.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Alc/panning.c b/Alc/panning.c index aa8175d4..bd550b32 100644 --- a/Alc/panning.c +++ b/Alc/panning.c @@ -1151,8 +1151,8 @@ void aluInitRenderer(ALCdevice *device, ALint hrtf_id, enum HrtfRequestMode hrtf if(hrtf_id >= 0 && (size_t)hrtf_id < VECTOR_SIZE(device->HrtfList)) { const EnumeratedHrtf *entry = &VECTOR_ELEM(device->HrtfList, hrtf_id); - const struct Hrtf *hrtf = entry->hrtf->handle; - if(hrtf->sampleRate == device->Frequency) + const struct Hrtf *hrtf = GetLoadedHrtf(entry->hrtf); + if(hrtf && hrtf->sampleRate == device->Frequency) { device->HrtfHandle = hrtf; alstr_copy(&device->HrtfName, entry->name); @@ -1162,8 +1162,8 @@ void aluInitRenderer(ALCdevice *device, ALint hrtf_id, enum HrtfRequestMode hrtf for(i = 0;!device->HrtfHandle && i < VECTOR_SIZE(device->HrtfList);i++) { const EnumeratedHrtf *entry = &VECTOR_ELEM(device->HrtfList, i); - const struct Hrtf *hrtf = entry->hrtf->handle; - if(hrtf->sampleRate == device->Frequency) + const struct Hrtf *hrtf = GetLoadedHrtf(entry->hrtf); + if(hrtf && hrtf->sampleRate == device->Frequency) { device->HrtfHandle = hrtf; alstr_copy(&device->HrtfName, entry->name); |