src/audio/SDL_audio.c
changeset 7447 6860de5bcb8c
parent 7446 6cbb6aaedc20
child 7518 febc83bc2a43
equal deleted inserted replaced
7446:6cbb6aaedc20 7447:6860de5bcb8c
   478                 if (stream == NULL) {
   478                 if (stream == NULL) {
   479                     stream = device->fake_stream;
   479                     stream = device->fake_stream;
   480                 }
   480                 }
   481             }
   481             }
   482 
   482 
       
   483             SDL_LockMutex(device->mixer_lock);
   483             if (device->paused) {
   484             if (device->paused) {
   484                 SDL_memset(stream, silence, stream_len);
   485                 SDL_memset(stream, silence, stream_len);
   485             } else {
   486             } else {
   486                 SDL_LockMutex(device->mixer_lock);
       
   487                 (*fill) (udata, stream, stream_len);
   487                 (*fill) (udata, stream, stream_len);
   488                 SDL_UnlockMutex(device->mixer_lock);
   488             }
   489             }
   489             SDL_UnlockMutex(device->mixer_lock);
   490 
   490 
   491             /* Convert the audio if necessary */
   491             /* Convert the audio if necessary */
   492             if (device->convert.needed) {
   492             if (device->convert.needed) {
   493                 SDL_ConvertAudio(&device->convert);
   493                 SDL_ConvertAudio(&device->convert);
   494                 stream = current_audio.impl.GetDeviceBuf(device);
   494                 stream = current_audio.impl.GetDeviceBuf(device);
  1112 void
  1112 void
  1113 SDL_PauseAudioDevice(SDL_AudioDeviceID devid, int pause_on)
  1113 SDL_PauseAudioDevice(SDL_AudioDeviceID devid, int pause_on)
  1114 {
  1114 {
  1115     SDL_AudioDevice *device = get_audio_device(devid);
  1115     SDL_AudioDevice *device = get_audio_device(devid);
  1116     if (device) {
  1116     if (device) {
       
  1117         current_audio.impl.LockDevice(device);
  1117         device->paused = pause_on;
  1118         device->paused = pause_on;
       
  1119         current_audio.impl.UnlockDevice(device);
  1118     }
  1120     }
  1119 }
  1121 }
  1120 
  1122 
  1121 void
  1123 void
  1122 SDL_PauseAudio(int pause_on)
  1124 SDL_PauseAudio(int pause_on)