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:
Ryan C. Gordon
2023-06-23 21:42:48 -04:00
parent db39cbf208
commit cdd2ba81de

View File

@@ -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);