Removed duplicate state from arts driver. SDL-ryan-multiple-audio-device
authorRyan C. Gordon
Fri, 06 Oct 2006 03:32:48 +0000
branchSDL-ryan-multiple-audio-device
changeset 381392f7304e50ff
parent 3812 35d1367020a3
child 3814 8e1af9ff0e1f
Removed duplicate state from arts driver.
src/audio/arts/SDL_artsaudio.c
     1.1 --- a/src/audio/arts/SDL_artsaudio.c	Fri Oct 06 02:40:02 2006 +0000
     1.2 +++ b/src/audio/arts/SDL_artsaudio.c	Fri Oct 06 03:32:48 2006 +0000
     1.3 @@ -51,7 +51,6 @@
     1.4  
     1.5  static const char *arts_library = SDL_AUDIO_DRIVER_ARTS_DYNAMIC;
     1.6  static void *arts_handle = NULL;
     1.7 -static int arts_loaded = 0;
     1.8  
     1.9  /* !!! FIXME: I hate this SDL_NAME clutter...it makes everything so messy! */
    1.10  static int (*SDL_NAME(arts_init)) (void);
    1.11 @@ -89,10 +88,9 @@
    1.12  static void
    1.13  UnloadARTSLibrary()
    1.14  {
    1.15 -    if (arts_loaded) {
    1.16 +    if (arts_handle != NULL) {
    1.17          SDL_UnloadObject(arts_handle);
    1.18          arts_handle = NULL;
    1.19 -        arts_loaded = 0;
    1.20      }
    1.21  }
    1.22  
    1.23 @@ -101,10 +99,9 @@
    1.24  {
    1.25      int i, retval = -1;
    1.26  
    1.27 -    if (!arts_loaded) {
    1.28 +    if (arts_handle == NULL) {
    1.29          arts_handle = SDL_LoadObject(arts_library);
    1.30 -        if (arts_handle) {
    1.31 -            arts_loaded = 1;
    1.32 +        if (arts_handle != NULL) {
    1.33              retval = 0;
    1.34              for (i = 0; i < SDL_arraysize(arts_functions); ++i) {
    1.35                  *arts_functions[i].func =