summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2009-05-19 06:37:22 -0700
committerChris Robinson <[email protected]>2009-05-19 06:37:22 -0700
commit3be399c55555fdce2a7cfe35d5893691136cdfa5 (patch)
tree034dd4fc507f6e4d0c785a425bcf83ab54b0362d
parent1f5453075c20018c450d57be4bf434d14beb9dbe (diff)
Do not open pulseaudio if it didn't load
-rw-r--r--Alc/pulseaudio.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/Alc/pulseaudio.c b/Alc/pulseaudio.c
index 83c7c84b..ee63fc3b 100644
--- a/Alc/pulseaudio.c
+++ b/Alc/pulseaudio.c
@@ -429,6 +429,9 @@ static void pulse_close(ALCdevice *device) //{{{
// OpenAL {{{
static ALCboolean pulse_open_playback(ALCdevice *device, const ALCchar *device_name) //{{{
{
+ if(!pa_handle)
+ return ALC_FALSE;
+
if(device_name)
{
if(strcmp(device_name, pulse_device) != 0)
@@ -445,6 +448,9 @@ static void pulse_close_playback(ALCdevice *device) //{{{
static ALCboolean pulse_open_capture(ALCdevice *device, const ALCchar *device_name, ALCuint frequency, ALCenum format, ALCsizei samples) //{{{
{
+ if(!pa_handle)
+ return ALC_FALSE;
+
if(device_name)
{
if(strcmp(device_name, pulse_capture_device) != 0)
@@ -538,6 +544,7 @@ void alc_pulse_init(BackendFuncs *func_list) //{{{
#else
+ pa_handle = (void*)0xDEADBEEF;
#define LOAD_FUNC(x) p##x = (x)
#endif