From 2a074cf7f2b2c2af344e8b9c2446a000b7053f38 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 9 Jan 2002 16:04:58 +0000 Subject: [PATCH] Don't allow multiple audio opens to succeed (until SDL 1.3) --- src/audio/SDL_audio.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/audio/SDL_audio.c b/src/audio/SDL_audio.c index 12fd1d87c..97085870e 100644 --- a/src/audio/SDL_audio.c +++ b/src/audio/SDL_audio.c @@ -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");