src/audio/alsa/SDL_alsa_audio.c
branchSDL-1.2
changeset 4361 991e4bcfc7a8
parent 4360 be2dff2f79c0
child 4362 e48a66bed093
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 		}