Mercurial > sdl-ios-xcode
comparison src/audio/alsa/SDL_alsa_audio.c @ 4361:991e4bcfc7a8 SDL-1.2
Added an error message for when ALSA audio fails
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Mon, 19 Oct 2009 05:15:21 +0000 |
parents | be2dff2f79c0 |
children | e48a66bed093 |
comparison
equal
deleted
inserted
replaced
4360:be2dff2f79c0 | 4361:991e4bcfc7a8 |
---|---|
312 frames_left = ((snd_pcm_uframes_t) this->spec.samples); | 312 frames_left = ((snd_pcm_uframes_t) this->spec.samples); |
313 | 313 |
314 while ( frames_left > 0 && this->enabled ) { | 314 while ( frames_left > 0 && this->enabled ) { |
315 status = SDL_NAME(snd_pcm_writei)(pcm_handle, sample_buf, frames_left); | 315 status = SDL_NAME(snd_pcm_writei)(pcm_handle, sample_buf, frames_left); |
316 if ( status < 0 ) { | 316 if ( status < 0 ) { |
317 if ( SDL_NAME(snd_pcm_recover)(pcm_handle, status, 0) < 0 ) { | 317 status = SDL_NAME(snd_pcm_recover)(pcm_handle, status, 0); |
318 if ( status < 0 ) { | |
318 /* Hmm, not much we can do - abort */ | 319 /* Hmm, not much we can do - abort */ |
320 fprintf(stderr, "ALSA write failed (unrecoverable): %s", SDL_NAME(snd_strerror)(status)); | |
319 this->enabled = 0; | 321 this->enabled = 0; |
320 return; | 322 return; |
321 } | 323 } |
322 continue; | 324 continue; |
323 } | 325 } |