From 75973f81b232643f62352ea6f760951433b530c2 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Thu, 19 Mar 2015 13:15:28 -0400 Subject: [PATCH] Don't assert if an audio backend reports the same device disconnected twice. --- src/audio/SDL_audio.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/audio/SDL_audio.c b/src/audio/SDL_audio.c index af88bb0e811cd..e00500b73b636 100644 --- a/src/audio/SDL_audio.c +++ b/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. */