src/audio/SDL_audio.c
changeset 7406 fb02213c11d3
parent 7367 d6eabafa8776
child 7407 db8a19d767d7
equal deleted inserted replaced
7405:5a9172b56b18 7406:fb02213c11d3
   459             }
   459             }
   460 
   460 
   461         }
   461         }
   462     } else {
   462     } else {
   463         /* Otherwise, do not use the streamer. This is the old code. */
   463         /* Otherwise, do not use the streamer. This is the old code. */
       
   464         const int silence = (int) device->spec.silence;
   464 
   465 
   465         /* Loop, filling the audio buffers */
   466         /* Loop, filling the audio buffers */
   466         while (device->enabled) {
   467         while (device->enabled) {
   467 
   468 
   468             if (device->paused) {
   469             if (device->paused) {
   482                 if (stream == NULL) {
   483                 if (stream == NULL) {
   483                     stream = device->fake_stream;
   484                     stream = device->fake_stream;
   484                 }
   485                 }
   485             }
   486             }
   486 
   487 
   487             SDL_LockMutex(device->mixer_lock);
   488             if (device->paused) {
   488             (*fill) (udata, stream, stream_len);
   489                 SDL_memset(stream, silence, stream_len);
   489             SDL_UnlockMutex(device->mixer_lock);
   490             } else {
       
   491                 SDL_LockMutex(device->mixer_lock);
       
   492                 (*fill) (udata, stream, stream_len);
       
   493                 SDL_UnlockMutex(device->mixer_lock);
       
   494             }
   490 
   495 
   491             /* Convert the audio if necessary */
   496             /* Convert the audio if necessary */
   492             if (device->convert.needed) {
   497             if (device->convert.needed) {
   493                 SDL_ConvertAudio(&device->convert);
   498                 SDL_ConvertAudio(&device->convert);
   494                 stream = current_audio.impl.GetDeviceBuf(device);
   499                 stream = current_audio.impl.GetDeviceBuf(device);