Explorar o código

Don't assert if an audio backend reports the same device disconnected twice.

Ryan C. Gordon %!s(int64=10) %!d(string=hai) anos
pai
achega
75973f81b2
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      src/audio/SDL_audio.c

+ 4 - 1
src/audio/SDL_audio.c

@@ -424,7 +424,10 @@ SDL_AddAudioDevice(const int iscapture, const char *name, void *handle)
 void SDL_OpenedAudioDeviceDisconnected(SDL_AudioDevice *device)
 {
     SDL_assert(get_audio_device(device->id) == device);
-    SDL_assert(device->enabled);  /* called more than once?! */
+
+    if (!device->enabled) {
+        return;
+    }
 
     /* Ends the audio callback and mark the device as STOPPED, but the
        app still needs to close the device to free resources. */