mirror of
https://github.com/yawut/SDL.git
synced 2026-09-13 11:36:32 -05:00
Don't allow multiple audio opens to succeed (until SDL 1.3)
This commit is contained in:
@@ -336,6 +336,11 @@ int SDL_OpenAudio(SDL_AudioSpec *desired, SDL_AudioSpec *obtained)
|
||||
}
|
||||
audio = current_audio;
|
||||
|
||||
if (audio->opened) {
|
||||
SDL_SetError("Audio device is already opened");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
/* Verify some parameters */
|
||||
if ( desired->callback == NULL ) {
|
||||
SDL_SetError("SDL_OpenAudio() passed a NULL callback");
|
||||
|
||||
Reference in New Issue
Block a user