Skip to content

Commit

Permalink
Don't allow multiple audio opens to succeed (until SDL 1.3)
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Jan 9, 2002
1 parent cddd7d5 commit 2a074cf
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/audio/SDL_audio.c
Expand Up @@ -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");
Expand Down

0 comments on commit 2a074cf

Please sign in to comment.