diff --git a/README.md b/README.md index 27872b5..582477b 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/src/alsa.cpp b/src/alsa.cpp index bb46011..d3a43b9 100644 --- a/src/alsa.cpp +++ b/src/alsa.cpp @@ -556,16 +556,17 @@ static int refresh_devices(SoundIoPrivate *si) { } SoundIoList *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; }