Mercurial > sdl-ios-xcode
comparison src/audio/alsa/SDL_alsa_audio.c @ 547:5d07f9a47f17
Open the ALSA devices in non-blocking mode (thanks Aleksey!)
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sun, 17 Nov 2002 20:01:54 +0000 |
parents | 5868b0f832f2 |
children | 4c2ba6161939 |
comparison
equal
deleted
inserted
replaced
546:0009aadb3d01 | 547:5d07f9a47f17 |
---|---|
72 int available; | 72 int available; |
73 int status; | 73 int status; |
74 snd_pcm_t *handle; | 74 snd_pcm_t *handle; |
75 | 75 |
76 available = 0; | 76 available = 0; |
77 status = snd_pcm_open(&handle, get_audio_device(), SND_PCM_STREAM_PLAYBACK, 0); | 77 status = snd_pcm_open(&handle, get_audio_device(), SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK); |
78 if ( status >= 0 ) { | 78 if ( status >= 0 ) { |
79 available = 1; | 79 available = 1; |
80 snd_pcm_close(handle); | 80 snd_pcm_close(handle); |
81 } | 81 } |
82 return(available); | 82 return(available); |
200 snd_pcm_format_t format; | 200 snd_pcm_format_t format; |
201 snd_pcm_uframes_t frames; | 201 snd_pcm_uframes_t frames; |
202 Uint16 test_format; | 202 Uint16 test_format; |
203 | 203 |
204 /* Open the audio device */ | 204 /* Open the audio device */ |
205 status = snd_pcm_open(&pcm_handle, get_audio_device(), SND_PCM_STREAM_PLAYBACK, 0); | 205 status = snd_pcm_open(&pcm_handle, get_audio_device(), SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK); |
206 if ( status < 0 ) { | 206 if ( status < 0 ) { |
207 SDL_SetError("Couldn't open audio device: %s", snd_strerror(status)); | 207 SDL_SetError("Couldn't open audio device: %s", snd_strerror(status)); |
208 return(-1); | 208 return(-1); |
209 } | 209 } |
210 | 210 |