Skip to content
Permalink
Browse files

Added an error message for when ALSA audio fails

  • Loading branch information
slouken committed Oct 19, 2009
1 parent 8f481b4 commit 3324bba77f85cdc7315806638a3fc5586a5b9e95
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/audio/alsa/SDL_alsa_audio.c
@@ -314,8 +314,10 @@ static void ALSA_PlayAudio(_THIS)
while ( frames_left > 0 && this->enabled ) {
status = SDL_NAME(snd_pcm_writei)(pcm_handle, sample_buf, frames_left);
if ( status < 0 ) {
if ( SDL_NAME(snd_pcm_recover)(pcm_handle, status, 0) < 0 ) {
status = SDL_NAME(snd_pcm_recover)(pcm_handle, status, 0);
if ( status < 0 ) {
/* Hmm, not much we can do - abort */
fprintf(stderr, "ALSA write failed (unrecoverable): %s", SDL_NAME(snd_strerror)(status));
this->enabled = 0;
return;
}

0 comments on commit 3324bba

Please sign in to comment.