Added an error message for when ALSA audio fails SDL-1.2
authorSam Lantinga <slouken@libsdl.org>
Mon, 19 Oct 2009 05:15:21 +0000
branchSDL-1.2
changeset 4361991e4bcfc7a8
parent 4360 be2dff2f79c0
child 4362 e48a66bed093
Added an error message for when ALSA audio fails
src/audio/alsa/SDL_alsa_audio.c
     1.1 --- a/src/audio/alsa/SDL_alsa_audio.c	Mon Oct 19 03:18:15 2009 +0000
     1.2 +++ b/src/audio/alsa/SDL_alsa_audio.c	Mon Oct 19 05:15:21 2009 +0000
     1.3 @@ -314,8 +314,10 @@
     1.4  	while ( frames_left > 0 && this->enabled ) {
     1.5  		status = SDL_NAME(snd_pcm_writei)(pcm_handle, sample_buf, frames_left);
     1.6  		if ( status < 0 ) {
     1.7 -			if ( SDL_NAME(snd_pcm_recover)(pcm_handle, status, 0) < 0 ) {
     1.8 +			status = SDL_NAME(snd_pcm_recover)(pcm_handle, status, 0);
     1.9 +			if ( status < 0 ) {
    1.10  				/* Hmm, not much we can do - abort */
    1.11 +				fprintf(stderr, "ALSA write failed (unrecoverable): %s", SDL_NAME(snd_strerror)(status));
    1.12  				this->enabled = 0;
    1.13  				return;
    1.14  			}