comparison src/audio/qsa/SDL_qsa_audio.c @ 3123:60301ed80050

Set audio device handle to NULL in case of open was not successful.
author Mike Gorchak <lestat@i.com.ua>
date Thu, 14 May 2009 11:50:05 +0000
parents 82e60908fab1
children 7f684f249ec9
comparison
equal deleted inserted replaced
3122:6c98826d88b0 3123:60301ed80050
90 QSA_Device qsa_capture_device[QSA_MAX_DEVICES]; 90 QSA_Device qsa_capture_device[QSA_MAX_DEVICES];
91 uint32_t qsa_capture_devices; 91 uint32_t qsa_capture_devices;
92 92
93 static inline void QSA_SetError(const char* fn, int status) 93 static inline void QSA_SetError(const char* fn, int status)
94 { 94 {
95 SDL_SetError("QSA: %s failed: %s", fn, snd_strerror(status)); 95 SDL_SetError("QSA: %s() failed: %s", fn, snd_strerror(status));
96 } 96 }
97 97
98 /* card names check to apply the workarounds */ 98 /* card names check to apply the workarounds */
99 static int QSA_CheckBuggyCards(_THIS, unsigned long checkfor) 99 static int QSA_CheckBuggyCards(_THIS, unsigned long checkfor)
100 { 100 {
477 } 477 }
478 478
479 /* Check if requested device is opened */ 479 /* Check if requested device is opened */
480 if (status<0) 480 if (status<0)
481 { 481 {
482 this->hidden->audio_handle=NULL;
482 QSA_CloseDevice(this); 483 QSA_CloseDevice(this);
483 QSA_SetError("snd_pcm_open", status); 484 QSA_SetError("snd_pcm_open", status);
484 return 0; 485 return 0;
485 } 486 }
486 487