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

Ryan C. Gordon 2015-03-19 13:15:28 -04:00
parent 7c4b88f2db
commit 75973f81b2
1 changed files with 4 additions and 1 deletions

View File

@ -424,7 +424,10 @@ SDL_AddAudioDevice(const int iscapture, const char *name, void *handle)
void SDL_OpenedAudioDeviceDisconnected(SDL_AudioDevice *device) void SDL_OpenedAudioDeviceDisconnected(SDL_AudioDevice *device)
{ {
SDL_assert(get_audio_device(device->id) == 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 /* Ends the audio callback and mark the device as STOPPED, but the
app still needs to close the device to free resources. */ app still needs to close the device to free resources. */