SDL_OpenAudio fix

Well, that was easier than I thought. :slight_smile:

There’s already a flag maintained, SDL_OpenAudio() just neglected to check it.

patch:

—snip.—
diff -u -r1.11 SDL_audio.c
— src/audio/SDL_audio.c 2001/12/14 12:38:02 1.11
+++ src/audio/SDL_audio.c 2002/01/09 14:11:11
@@ -336,6 +336,11 @@
}
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”);
    —snip.—

–ryan.

Well, that was easier than I thought. :slight_smile:

There’s already a flag maintained, SDL_OpenAudio() just neglected to check it.

Heheh, thanks. :slight_smile:

-Sam Lantinga, Software Engineer, Blizzard Entertainment