diff options
author | Chris Robinson <[email protected]> | 2010-08-04 04:56:07 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2010-08-04 04:56:07 -0700 |
commit | f6b2dfd09f41c239cccac946ff199a7c5d1128af (patch) | |
tree | ae2b7745d26c848e0463bd656a22405c527c959f /Alc/pulseaudio.c | |
parent | 7f9bcfbc7d84caccce6647b197b55e57b0b0892f (diff) |
Only except a NULL device name for Pulse if some devices were found
Diffstat (limited to 'Alc/pulseaudio.c')
-rw-r--r-- | Alc/pulseaudio.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/Alc/pulseaudio.c b/Alc/pulseaudio.c index 2104d8c1..8401b715 100644 --- a/Alc/pulseaudio.c +++ b/Alc/pulseaudio.c @@ -680,7 +680,7 @@ static void probe_devices(ALboolean capture) if(capture == AL_FALSE) { allDevNameMap = malloc(sizeof(DevMap) * 1); - allDevNameMap[0].name = strdup("PulseAudio Default"); + allDevNameMap[0].name = strdup(pulse_device); allDevNameMap[0].device_name = NULL; numDevNames = 1; @@ -689,7 +689,7 @@ static void probe_devices(ALboolean capture) else { allCaptureDevNameMap = malloc(sizeof(DevMap) * 1); - allCaptureDevNameMap[0].name = strdup("PulseAudio Default"); + allCaptureDevNameMap[0].name = strdup(pulse_device); allCaptureDevNameMap[0].device_name = NULL; numCaptureDevNames = 1; @@ -792,15 +792,15 @@ static ALCboolean pulse_open_playback(ALCdevice *device, const ALCchar *device_n if(!pulse_load()) return ALC_FALSE; - if(!device_name) - device_name = pulse_device; - else if(strcmp(device_name, pulse_device) != 0) + if(!allDevNameMap) + probe_devices(AL_FALSE); + + if(!device_name && numDevNames > 0) + device_name = allDevNameMap[0].name; + else { ALuint i; - if(!allDevNameMap) - probe_devices(AL_FALSE); - for(i = 0;i < numDevNames;i++) { if(strcmp(device_name, allDevNameMap[i].name) == 0) @@ -1039,7 +1039,7 @@ static ALCboolean pulse_open_capture(ALCdevice *device, const ALCchar *device_na if(!allCaptureDevNameMap) probe_devices(AL_TRUE); - if(!device_name) + if(!device_name && numCaptureDevNames > 0) device_name = allCaptureDevNameMap[0].name; else { |