diff options
author | Chris Robinson <[email protected]> | 2015-09-20 04:10:21 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2015-09-20 08:28:34 -0700 |
commit | 5f5eebc4df536daef7f68d02f7a0c751c8dc0f79 (patch) | |
tree | d86069c47e3b05437b97601102a2104a96ac7b6e /Alc/hrtf.c | |
parent | 46bbf95bae605ac8be1ca163e337b33928627960 (diff) |
Allow the hrtf_tables option to be device-specific
Diffstat (limited to 'Alc/hrtf.c')
-rw-r--r-- | Alc/hrtf.c | 15 |
1 files changed, 7 insertions, 8 deletions
@@ -726,11 +726,11 @@ static struct Hrtf *LoadHrtf01(FILE *f, ALuint deviceRate) } -static struct Hrtf *LoadHrtf(ALuint deviceRate) +static struct Hrtf *LoadHrtf(const_al_string devname, ALuint deviceRate) { const char *fnamelist = "default-%r.mhr"; - ConfigValueStr(NULL, NULL, "hrtf_tables", &fnamelist); + ConfigValueStr(al_string_get_cstr(devname), NULL, "hrtf_tables", &fnamelist); while(*fnamelist != '\0') { struct Hrtf *Hrtf = NULL; @@ -823,7 +823,7 @@ static struct Hrtf *LoadHrtf(ALuint deviceRate) return NULL; } -const struct Hrtf *GetHrtf(enum DevFmtChannels chans, ALCuint srate) +const struct Hrtf *GetHrtf(const_al_string devname, enum DevFmtChannels chans, ALCuint srate) { if(chans == DevFmtStereo) { @@ -835,15 +835,14 @@ const struct Hrtf *GetHrtf(enum DevFmtChannels chans, ALCuint srate) Hrtf = Hrtf->next; } - Hrtf = LoadHrtf(srate); - if(Hrtf != NULL) - return Hrtf; + Hrtf = LoadHrtf(devname, srate); + if(Hrtf != NULL) return Hrtf; } ERR("Incompatible format: %s %uhz\n", DevFmtChannelsString(chans), srate); return NULL; } -ALCboolean FindHrtfFormat(enum DevFmtChannels *chans, ALCuint *srate) +ALCboolean FindHrtfFormat(const_al_string devname, enum DevFmtChannels *chans, ALCuint *srate) { const struct Hrtf *hrtf = LoadedHrtfs; while(hrtf != NULL) @@ -855,7 +854,7 @@ ALCboolean FindHrtfFormat(enum DevFmtChannels *chans, ALCuint *srate) if(hrtf == NULL) { - hrtf = LoadHrtf(*srate); + hrtf = LoadHrtf(devname, *srate); if(hrtf == NULL) return ALC_FALSE; } |