Pass a normal const char* to EnumerateHrtf

This commit is contained in:
Chris Robinson 2018-11-15 05:38:27 -08:00
parent 9d9d626d99
commit ab9f8162b8
4 changed files with 8 additions and 9 deletions

View File

@ -1996,7 +1996,7 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const ALCint *attrList)
if(VECTOR_SIZE(device->HrtfList) == 0)
{
VECTOR_DEINIT(device->HrtfList);
device->HrtfList = EnumerateHrtf(device->DeviceName);
device->HrtfList = EnumerateHrtf(alstr_get_cstr(device->DeviceName));
}
if(VECTOR_SIZE(device->HrtfList) > 0)
{
@ -3448,7 +3448,7 @@ static ALCsizei GetIntegerv(ALCdevice *device, ALCenum param, ALCsizei size, ALC
case ALC_NUM_HRTF_SPECIFIERS_SOFT:
almtx_lock(&device->BackendLock);
FreeHrtfList(&device->HrtfList);
device->HrtfList = EnumerateHrtf(device->DeviceName);
device->HrtfList = EnumerateHrtf(alstr_get_cstr(device->DeviceName));
values[0] = (ALCint)VECTOR_SIZE(device->HrtfList);
almtx_unlock(&device->BackendLock);
return 1;

View File

@ -1116,13 +1116,13 @@ ResData GetResource(int name)
} // namespace
vector_EnumeratedHrtf EnumerateHrtf(const_al_string devname)
vector_EnumeratedHrtf EnumerateHrtf(const char *devname)
{
vector_EnumeratedHrtf list{VECTOR_INIT_STATIC()};
bool usedefaults{true};
const char *pathlist{""};
if(ConfigValueStr(alstr_get_cstr(devname), nullptr, "hrtf-paths", &pathlist))
if(ConfigValueStr(devname, nullptr, "hrtf-paths", &pathlist))
{
while(pathlist && *pathlist)
{
@ -1154,7 +1154,7 @@ vector_EnumeratedHrtf EnumerateHrtf(const_al_string devname)
pathlist = next;
}
}
else if(ConfigValueExists(alstr_get_cstr(devname), nullptr, "hrtf_tables"))
else if(ConfigValueExists(devname, nullptr, "hrtf_tables"))
ERR("The hrtf_tables option is deprecated, please use hrtf-paths instead.\n");
if(usedefaults)
@ -1172,7 +1172,7 @@ vector_EnumeratedHrtf EnumerateHrtf(const_al_string devname)
}
const char *defaulthrtf{""};
if(VECTOR_SIZE(list) > 1 && ConfigValueStr(alstr_get_cstr(devname), nullptr, "default-hrtf", &defaulthrtf))
if(VECTOR_SIZE(list) > 1 && ConfigValueStr(devname, nullptr, "default-hrtf", &defaulthrtf))
{
const EnumeratedHrtf *iter{};
/* Find the preferred HRTF and move it to the front of the list. */

View File

@ -5,7 +5,6 @@
#include "AL/alc.h"
#include "alMain.h"
#include "alstring.h"
#include "atomic.h"
@ -69,7 +68,7 @@ struct AngularPoint {
void FreeHrtfs(void);
vector_EnumeratedHrtf EnumerateHrtf(const_al_string devname);
vector_EnumeratedHrtf EnumerateHrtf(const char *devname);
void FreeHrtfList(vector_EnumeratedHrtf *list);
struct Hrtf *GetLoadedHrtf(struct HrtfEntry *entry);
void Hrtf_IncRef(struct Hrtf *hrtf);

View File

@ -1116,7 +1116,7 @@ void aluInitRenderer(ALCdevice *device, ALint hrtf_id, enum HrtfRequestMode hrtf
if(VECTOR_SIZE(device->HrtfList) == 0)
{
VECTOR_DEINIT(device->HrtfList);
device->HrtfList = EnumerateHrtf(device->DeviceName);
device->HrtfList = EnumerateHrtf(alstr_get_cstr(device->DeviceName));
}
if(hrtf_id >= 0 && (size_t)hrtf_id < VECTOR_SIZE(device->HrtfList))