mirror of
https://github.com/Ryujinx/libsoundio.git
synced 2024-12-22 21:55:36 +00:00
ALSA: detect 'default' (no colon) as default device
This commit is contained in:
parent
31678c7777
commit
a5e1c0024d
|
@ -273,8 +273,6 @@ view `coverage/index.html` in a browser.
|
|||
call lock and then unlock when done.
|
||||
0. Should pause/resume be callable from outside the callbacks?
|
||||
0. device.name -> device.id, device.description -> device.name
|
||||
0. PulseAudio: when opening a device start it corked that way we can get
|
||||
accurate buffer readings
|
||||
0. clean up API and improve documentation
|
||||
- make sure every function which can return an error documents which errors
|
||||
it can return
|
||||
|
|
|
@ -556,16 +556,17 @@ static int refresh_devices(SoundIoPrivate *si) {
|
|||
}
|
||||
|
||||
SoundIoList<SoundIoDevice *> *device_list;
|
||||
bool is_default = str_has_prefix(name, "default:") || strcmp(name, "default") == 0;
|
||||
if (stream == SND_PCM_STREAM_PLAYBACK) {
|
||||
device->purpose = SoundIoDevicePurposeOutput;
|
||||
device_list = &devices_info->output_devices;
|
||||
if (devices_info->default_output_index < 0 && str_has_prefix(name, "default:"))
|
||||
if (devices_info->default_output_index < 0 && is_default)
|
||||
devices_info->default_output_index = device_list->length;
|
||||
} else {
|
||||
assert(stream == SND_PCM_STREAM_CAPTURE);
|
||||
device->purpose = SoundIoDevicePurposeInput;
|
||||
device_list = &devices_info->input_devices;
|
||||
if (devices_info->default_input_index < 0 && str_has_prefix(name, "default:"))
|
||||
if (devices_info->default_input_index < 0 && is_default)
|
||||
devices_info->default_input_index = device_list->length;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue