mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-16 23:06:03 +00:00
audio: take first reported device if no default was specified.
This commit is contained in:
@@ -579,7 +579,13 @@ int SDL_InitAudio(const char *driver_name)
|
||||
current_audio.default_capture_device_id = default_capture->instance_id;
|
||||
}
|
||||
|
||||
// !!! FIXME: if a default is zero but there are devices available, should we just pick the first one?
|
||||
// If no default was _ever_ specified, just take the first device we see, if any.
|
||||
if (!current_audio.default_output_device_id && (current_audio.output_devices != NULL)) {
|
||||
current_audio.default_output_device_id = current_audio.output_devices->instance_id;
|
||||
}
|
||||
if (!current_audio.default_capture_device_id && (current_audio.capture_devices != NULL)) {
|
||||
current_audio.default_capture_device_id = current_audio.capture_devices->instance_id;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user