src/audio/bsd/SDL_bsdaudio.c
changeset 10232 216367257386
parent 9998 f67cf37e9cd4
child 10233 449a75328029
equal deleted inserted replaced
10231:0bd26418c5e4 10232:216367257386
   180             /* Non recoverable error has occurred. It should be reported!!! */
   180             /* Non recoverable error has occurred. It should be reported!!! */
   181             perror("audio");
   181             perror("audio");
   182             break;
   182             break;
   183         }
   183         }
   184 
   184 
   185         if (p < written
   185 #ifdef DEBUG_AUDIO
       
   186         fprintf(stderr, "Wrote %d bytes of audio data\n", written);
       
   187 #endif
       
   188 
       
   189         if (p < this->hidden->mixlen
   186             || ((written < 0) && ((errno == 0) || (errno == EAGAIN)))) {
   190             || ((written < 0) && ((errno == 0) || (errno == EAGAIN)))) {
   187             SDL_Delay(1);       /* Let a little CPU time go by */
   191             SDL_Delay(1);       /* Let a little CPU time go by */
   188         }
   192         }
   189     } while (p < written);
   193     } while (p < this->hidden->mixlen);
   190 
   194 
   191     /* If timer synchronization is enabled, set the next write frame */
   195     /* If timer synchronization is enabled, set the next write frame */
   192     if (this->hidden->frame_ticks) {
   196     if (this->hidden->frame_ticks) {
   193         this->hidden->next_frame += this->hidden->frame_ticks;
   197         this->hidden->next_frame += this->hidden->frame_ticks;
   194     }
   198     }
   195 
   199 
   196     /* If we couldn't write, assume fatal error for now */
   200     /* If we couldn't write, assume fatal error for now */
   197     if (written < 0) {
   201     if (written < 0) {
   198         SDL_OpenedAudioDeviceDisconnected(this);
   202         SDL_OpenedAudioDeviceDisconnected(this);
   199     }
   203     }
   200 #ifdef DEBUG_AUDIO
       
   201     fprintf(stderr, "Wrote %d bytes of audio data\n", written);
       
   202 #endif
       
   203 }
   204 }
   204 
   205 
   205 static Uint8 *
   206 static Uint8 *
   206 BSDAUDIO_GetDeviceBuf(_THIS)
   207 BSDAUDIO_GetDeviceBuf(_THIS)
   207 {
   208 {