From 3324bba77f85cdc7315806638a3fc5586a5b9e95 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 19 Oct 2009 05:15:21 +0000 Subject: [PATCH] Added an error message for when ALSA audio fails --- src/audio/alsa/SDL_alsa_audio.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/audio/alsa/SDL_alsa_audio.c b/src/audio/alsa/SDL_alsa_audio.c index 5bf3ffeb2..540b319a3 100644 --- a/src/audio/alsa/SDL_alsa_audio.c +++ b/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; }