Explorar o código

Make sure we update device->sample_frames in SDL_AudioDeviceFormatChangedAlreadyLocked()

WASAPI_GetDeviceBuf() will fail if we don't request the correct buffer size
Sam Lantinga %!s(int64=2) %!d(string=hai) anos
pai
achega
2e92e94ebb
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/audio/SDL_audio.c

+ 1 - 1
src/audio/SDL_audio.c

@@ -1947,7 +1947,7 @@ int SDL_AudioDeviceFormatChangedAlreadyLocked(SDL_AudioDevice *device, const SDL
 {
 {
     const int orig_work_buffer_size = device->work_buffer_size;
     const int orig_work_buffer_size = device->work_buffer_size;
 
 
-    if (AUDIO_SPECS_EQUAL(device->spec, *newspec)) {
+    if (AUDIO_SPECS_EQUAL(device->spec, *newspec) && new_sample_frames == device->sample_frames) {
         return 0;  // we're already in that format.
         return 0;  // we're already in that format.
     }
     }