Fixes #2227: removed wrong check for SDL Audio initialization

This commit is contained in:
Damjan Adamic
2015-04-25 18:03:47 +02:00
parent 2a667d1d53
commit eac8c0a535
2 changed files with 16 additions and 6 deletions
+3 -1
View File
@@ -107,7 +107,9 @@ int main(int argc, char *argv[])
#ifdef SIMU_AUDIO
sdlFlags |= SDL_INIT_AUDIO;
#endif
SDL_Init(sdlFlags);
if (SDL_Init(sdlFlags) < 0) {
fprintf(stderr, "ERROR: couldn't initialize SDL: %s\n", SDL_GetError());
}
#endif
registerEEpromInterfaces();
+13 -5
View File
@@ -498,10 +498,15 @@ bool audio_thread_running = false;
void *audio_thread(void *)
{
if ( !SDL_WasInit(SDL_INIT_AUDIO) ) {
fprintf(stderr, "ERROR: couldn't initialize SDL audio support\n");
return 0;
}
/*
Checking here if SDL audio was initialized is wrong, because
the SDL_CloseAudio() de-initializes it.
if ( !SDL_WasInit(SDL_INIT_AUDIO) ) {
fprintf(stderr, "ERROR: couldn't initialize SDL audio support\n");
return 0;
}
*/
SDL_AudioSpec wanted, have;
@@ -513,7 +518,10 @@ void *audio_thread(void *)
wanted.callback = fill_audio;
wanted.userdata = NULL;
/* Open the audio device, forcing the desired format */
/*
SDL_OpenAudio() internally calls SDL_InitSubSystem(SDL_INIT_AUDIO),
which initializes SDL Audio subsystem if necessary
*/
if ( SDL_OpenAudio(&wanted, &have) < 0 ) {
fprintf(stderr, "Couldn't open audio: %s\n", SDL_GetError());
return 0;