mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-12-16 19:35:41 +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);
|
device->instance_id = assign_audio_device_instance_id(iscapture, /*islogical=*/SDL_FALSE);
|
||||||
|
|
||||||
SDL_LockRWLockForWriting(current_audio.device_list_lock);
|
SDL_LockRWLockForWriting(current_audio.device_list_lock);
|
||||||
|
|
||||||
|
if (*devices) {
|
||||||
|
SDL_assert((*devices)->prev == NULL);
|
||||||
|
(*devices)->prev = device;
|
||||||
|
}
|
||||||
device->next = *devices;
|
device->next = *devices;
|
||||||
*devices = device;
|
*devices = device;
|
||||||
SDL_AtomicIncRef(device_count);
|
SDL_AtomicIncRef(device_count);
|
||||||
|
|||||||
Reference in New Issue
Block a user