diff 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
line wrap: on
line diff
--- a/src/audio/alsa/SDL_alsa_audio.c	Mon Oct 19 03:18:15 2009 +0000
+++ b/src/audio/alsa/SDL_alsa_audio.c	Mon Oct 19 05:15:21 2009 +0000
@@ -314,8 +314,10 @@
 	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;
 			}