Removed duplicate state from arts driver. SDL-ryan-multiple-audio-device
authorRyan C. Gordon <icculus@icculus.org>
Fri, 06 Oct 2006 03:32:48 +0000
branchSDL-ryan-multiple-audio-device
changeset 3813 92f7304e50ff
parent 3812 35d1367020a3
child 3814 8e1af9ff0e1f
Removed duplicate state from arts driver.
src/audio/arts/SDL_artsaudio.c
--- a/src/audio/arts/SDL_artsaudio.c	Fri Oct 06 02:40:02 2006 +0000
+++ b/src/audio/arts/SDL_artsaudio.c	Fri Oct 06 03:32:48 2006 +0000
@@ -51,7 +51,6 @@
 
 static const char *arts_library = SDL_AUDIO_DRIVER_ARTS_DYNAMIC;
 static void *arts_handle = NULL;
-static int arts_loaded = 0;
 
 /* !!! FIXME: I hate this SDL_NAME clutter...it makes everything so messy! */
 static int (*SDL_NAME(arts_init)) (void);
@@ -89,10 +88,9 @@
 static void
 UnloadARTSLibrary()
 {
-    if (arts_loaded) {
+    if (arts_handle != NULL) {
         SDL_UnloadObject(arts_handle);
         arts_handle = NULL;
-        arts_loaded = 0;
     }
 }
 
@@ -101,10 +99,9 @@
 {
     int i, retval = -1;
 
-    if (!arts_loaded) {
+    if (arts_handle == NULL) {
         arts_handle = SDL_LoadObject(arts_library);
-        if (arts_handle) {
-            arts_loaded = 1;
+        if (arts_handle != NULL) {
             retval = 0;
             for (i = 0; i < SDL_arraysize(arts_functions); ++i) {
                 *arts_functions[i].func =