From 01d8d956da139180174cea333633023b675dd264 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Mon, 20 Feb 2012 21:03:54 -0800 Subject: Avoid using a default name when opening a PulseAudio device --- Alc/backends/pulseaudio.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'Alc/backends') diff --git a/Alc/backends/pulseaudio.c b/Alc/backends/pulseaudio.c index 1e4086e1..64204814 100644 --- a/Alc/backends/pulseaudio.c +++ b/Alc/backends/pulseaudio.c @@ -216,7 +216,6 @@ typedef struct { } DevMap; -static const ALCchar pulse_device[] = "PulseAudio Default"; static DevMap *allDevNameMap; static ALuint numDevNames; static DevMap *allCaptureDevNameMap; @@ -823,9 +822,12 @@ static ALCenum pulse_open_playback(ALCdevice *device, const ALCchar *device_name if(!allDevNameMap) probe_devices(AL_FALSE); - if(!device_name) - device_name = pulse_device; - else if(strcmp(device_name, pulse_device) != 0) + if(!device_name && numDevNames > 0) + { + device_name = allDevNameMap[0].name; + pulse_name = allDevNameMap[0].device_name; + } + else { ALuint i; -- cgit v1.2.3