src/audio/alsa/SDL_alsa_audio.c
branchSDL-1.2
changeset 4337 4eb6b4be1dbc
parent 4336 77b20871fd44
child 4339 819270e2f893
equal deleted inserted replaced
4336:77b20871fd44 4337:4eb6b4be1dbc
   321 
   321 
   322 	swizzle_alsa_channels(this);
   322 	swizzle_alsa_channels(this);
   323 
   323 
   324 	frames_left = ((snd_pcm_uframes_t) this->spec.samples);
   324 	frames_left = ((snd_pcm_uframes_t) this->spec.samples);
   325 
   325 
   326 	while ( frames_left > 0 ) {
   326 	while ( frames_left > 0 && this->enabled ) {
   327 		status = SDL_NAME(snd_pcm_writei)(pcm_handle, sample_buf, frames_left);
   327 		status = SDL_NAME(snd_pcm_writei)(pcm_handle, sample_buf, frames_left);
   328 		if ( status < 0 ) {
   328 		if ( status < 0 ) {
   329 			if ( status == -EAGAIN ) {
   329 			if ( status == -EAGAIN ) {
   330 				SDL_Delay(1);
   330 				SDL_Delay(1);
   331 				continue;
   331 				continue;