diff options
author | Thilo Schulz <arny@ats.s.bawue.de> | 2011-07-22 16:43:27 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2013-01-10 22:33:36 +0000 |
commit | 0924ab7ab33596b30471bb70fc5f3f19329b0b37 (patch) | |
tree | 93cfcf265f6fd0eee5603457630f3026a4a90ebe /src/client/snd_openal.c | |
parent | 9ea5566eb376f8bb954d0614d141ea63fa390064 (diff) |
Fix client crash on windows with old OpenAL
Diffstat (limited to 'src/client/snd_openal.c')
-rw-r--r-- | src/client/snd_openal.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/client/snd_openal.c b/src/client/snd_openal.c index 488e073e..b594732e 100644 --- a/src/client/snd_openal.c +++ b/src/client/snd_openal.c @@ -2429,7 +2429,7 @@ qboolean S_AL_Init( soundInterface_t *si ) int curlen; // get all available devices + the default device name. - if(enumeration_ext) + if(enumeration_all_ext) { devicelist = qalcGetString(NULL, ALC_ALL_DEVICES_SPECIFIER); defaultdevice = qalcGetString(NULL, ALC_DEFAULT_ALL_DEVICES_SPECIFIER); @@ -2447,18 +2447,24 @@ qboolean S_AL_Init( soundInterface_t *si ) // Generic Software as that one works more reliably with various sound systems. // If it's not, use OpenAL's default selection as we don't want to ignore // native hardware acceleration. - if(!device && !strcmp(defaultdevice, "Generic Hardware")) + if(!device && defaultdevice && !strcmp(defaultdevice, "Generic Hardware")) device = "Generic Software"; #endif // dump a list of available devices to a cvar for the user to see. - while((curlen = strlen(devicelist))) + + if(devicelist) { - Q_strcat(devicenames, sizeof(devicenames), devicelist); - Q_strcat(devicenames, sizeof(devicenames), "\n"); + while((curlen = strlen(devicelist))) + { + Q_strcat(devicenames, sizeof(devicenames), devicelist); + Q_strcat(devicenames, sizeof(devicenames), "\n"); - devicelist += curlen + 1; + devicelist += curlen + 1; + } } + else + devicelist = ""; s_alAvailableDevices = Cvar_Get("s_alAvailableDevices", devicenames, CVAR_ROM | CVAR_NORESTART); } |