Don't allow multiple audio opens to succeed (until SDL 1.3)

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40263
This commit is contained in:
Sam Lantinga 2002-01-09 16:04:58 +00:00
parent 551057f96e
commit a7215581c7

View file

@ -336,6 +336,11 @@ int SDL_OpenAudio(SDL_AudioSpec *desired, SDL_AudioSpec *obtained)
} }
audio = current_audio; audio = current_audio;
if (audio->opened) {
SDL_SetError("Audio device is already opened");
return(-1);
}
/* Verify some parameters */ /* Verify some parameters */
if ( desired->callback == NULL ) { if ( desired->callback == NULL ) {
SDL_SetError("SDL_OpenAudio() passed a NULL callback"); SDL_SetError("SDL_OpenAudio() passed a NULL callback");