comparison src/audio/SDL_audio.c @ 2979:d578ae900755

Fixed crash on Windows
author Sam Lantinga <slouken@libsdl.org>
date Sat, 03 Jan 2009 07:33:42 +0000
parents fec0db6c44b7
children 0b160c970b7e
comparison
equal deleted inserted replaced
2978:4c9130d66e2c 2979:d578ae900755
26 #include "SDL.h" 26 #include "SDL.h"
27 #include "SDL_audio_c.h" 27 #include "SDL_audio_c.h"
28 #include "SDL_audiomem.h" 28 #include "SDL_audiomem.h"
29 #include "SDL_sysaudio.h" 29 #include "SDL_sysaudio.h"
30 30
31 #define _THIS SDL_AudioDevice *this 31 #define _THIS SDL_AudioDevice *this
32 32
33 static SDL_AudioDriver current_audio; 33 static SDL_AudioDriver current_audio;
34 static SDL_AudioDevice *open_devices[16]; 34 static SDL_AudioDevice *open_devices[16];
35 35
36 /* !!! FIXME: These are wordy and unlocalized... */ 36 /* !!! FIXME: These are wordy and unlocalized... */
623 rc = backend->init(&current_audio.impl); 623 rc = backend->init(&current_audio.impl);
624 if (rc == 2) { /* init'd, and devices available. Take it! */ 624 if (rc == 2) { /* init'd, and devices available. Take it! */
625 initialized = 1; 625 initialized = 1;
626 best_choice = i; 626 best_choice = i;
627 } else if (rc == 1) { /* init'd, but can't see any devices. */ 627 } else if (rc == 1) { /* init'd, but can't see any devices. */
628 current_audio.impl.Deinitialize(); 628 if (current_audio.impl.Deinitialize) {
629 current_audio.impl.Deinitialize();
630 }
629 if (best_choice == -1) { 631 if (best_choice == -1) {
630 best_choice = i; 632 best_choice = i;
631 } 633 }
632 } 634 }
633 } 635 }