mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-12-15 19:05:32 +00:00
audio: Fixed adding new physical devices to a double-linked list.
(Forgot to hook up existing node's `prev` field when adding the new device to the head of the list. Doh.)
This commit is contained in:
@@ -246,6 +246,11 @@ static SDL_AudioDevice *CreatePhysicalAudioDevice(const char *name, SDL_bool isc
|
||||
device->instance_id = assign_audio_device_instance_id(iscapture, /*islogical=*/SDL_FALSE);
|
||||
|
||||
SDL_LockRWLockForWriting(current_audio.device_list_lock);
|
||||
|
||||
if (*devices) {
|
||||
SDL_assert((*devices)->prev == NULL);
|
||||
(*devices)->prev = device;
|
||||
}
|
||||
device->next = *devices;
|
||||
*devices = device;
|
||||
SDL_AtomicIncRef(device_count);
|
||||
|
||||
Reference in New Issue
Block a user