aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2008-01-11 13:00:30 -0800
committerChris Robinson <[email protected]>2008-01-11 13:00:30 -0800
commit40241b4e970c451f37f805c0611e7b9d62b6ba30 (patch)
tree5fe534f7b86eaad34361a390119eebe807938654 /Alc
parentf10408739e22cea6b3c52b8a9f6e36792c33d855 (diff)
Don't attempt to open ALSA playback/capture if it didn't load
Diffstat (limited to 'Alc')
-rw-r--r--Alc/alsa.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/Alc/alsa.c b/Alc/alsa.c
index ea6ab2ea..f8cb17f7 100644
--- a/Alc/alsa.c
+++ b/Alc/alsa.c
@@ -325,6 +325,9 @@ static ALCboolean alsa_open_playback(ALCdevice *device, const ALCchar *deviceNam
char *err;
int i;
+ if(!alsa_handle)
+ return ALC_FALSE;
+
strncpy(driver, GetConfigValue("alsa", "device", "default"), sizeof(driver)-1);
driver[sizeof(driver)-1] = 0;
if(deviceName)
@@ -518,6 +521,9 @@ static ALCboolean alsa_open_capture(ALCdevice *pDevice, const ALCchar *deviceNam
char *err;
int i;
+ if(!alsa_handle)
+ return ALC_FALSE;
+
strncpy(driver, GetConfigValue("alsa", "capture", "default"), sizeof(driver)-1);
driver[sizeof(driver)-1] = 0;
if(deviceName)
@@ -758,7 +764,7 @@ void alc_alsa_init(BackendFuncs *func_list)
} while(0)
#else
str = NULL;
- alsa_handle = NULL;
+ alsa_handle = 0xDEADBEEF;
#define LOAD_FUNC(f) p##f = f
#endif