comparison src/audio/alsa/SDL_alsa_audio.c @ 3845:ee5dfa7f7993 SDL-ryan-multiple-audio-device

ALSA's availability test was wrong in multi-device land. If the ALSA libraries are available, we should use them and report zero available devices instead.
author Ryan C. Gordon <icculus@icculus.org>
date Tue, 17 Oct 2006 08:04:51 +0000
parents 25052dd25810
children 66fb40445587
comparison
equal deleted inserted replaced
3844:332a59e39ce1 3845:ee5dfa7f7993
219 219
220 static int 220 static int
221 ALSA_Available(void) 221 ALSA_Available(void)
222 { 222 {
223 int available = 0; 223 int available = 0;
224 int status;
225 snd_pcm_t *handle;
226 224
227 if (LoadALSALibrary() >= 0) { 225 if (LoadALSALibrary() >= 0) {
228 int status = ALSA_snd_pcm_open(&handle, get_audio_device(2), 226 available = 1;
229 SND_PCM_STREAM_PLAYBACK,
230 SND_PCM_NONBLOCK);
231 if (status >= 0) {
232 available = 1;
233 ALSA_snd_pcm_close(handle);
234 }
235 UnloadALSALibrary(); 227 UnloadALSALibrary();
236 } 228 }
237 return (available); 229 return (available);
238 } 230 }
239 231