Set audio device handle to NULL in case of open was not successful.
authorMike Gorchak <lestat@i.com.ua>
Thu, 14 May 2009 11:50:05 +0000
changeset 3123 60301ed80050
parent 3122 6c98826d88b0
child 3124 d7174e9f65ce
Set audio device handle to NULL in case of open was not successful.
src/audio/qsa/SDL_qsa_audio.c
--- a/src/audio/qsa/SDL_qsa_audio.c	Thu May 14 10:54:34 2009 +0000
+++ b/src/audio/qsa/SDL_qsa_audio.c	Thu May 14 11:50:05 2009 +0000
@@ -92,7 +92,7 @@
 
 static inline void QSA_SetError(const char* fn, int status)
 {
-   SDL_SetError("QSA: %s failed: %s", fn, snd_strerror(status));
+   SDL_SetError("QSA: %s() failed: %s", fn, snd_strerror(status));
 }
 
 /* card names check to apply the workarounds */
@@ -479,6 +479,7 @@
    /* Check if requested device is opened */
    if (status<0)
    {
+      this->hidden->audio_handle=NULL;
       QSA_CloseDevice(this);
       QSA_SetError("snd_pcm_open", status);
       return 0;