From 19d2f7bce6a4d0566a07f3187d2bc5f0ec95c1c4 Mon Sep 17 00:00:00 2001 From: Miriam Zimmerman Date: Fri, 30 Aug 2024 15:52:03 -0400 Subject: [PATCH] wasapi: Fix default device handling. Prior to https://github.com/mozilla/cubeb/pull/682, a device could be default for all of MULTIMEDIA, NOTIFICATION, and VOICE. After that PR, the first two were mutually exclusive with the third, I believe unintentionally. Restore this behavior so that, e.g., on devices with only one output device, querying for the "voice" device returns that device. --- src/cubeb_wasapi.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cubeb_wasapi.cpp b/src/cubeb_wasapi.cpp index 01417a5..f13c5ad 100644 --- a/src/cubeb_wasapi.cpp +++ b/src/cubeb_wasapi.cpp @@ -3323,7 +3323,8 @@ wasapi_create_device(cubeb * ctx, cubeb_device_info & ret, ret.preferred = (cubeb_device_pref)(ret.preferred | CUBEB_DEVICE_PREF_MULTIMEDIA | CUBEB_DEVICE_PREF_NOTIFICATION); - } else if (defaults->is_default(flow, eCommunications, device_id.get())) { + } + if (defaults->is_default(flow, eCommunications, device_id.get())) { ret.preferred = (cubeb_device_pref)(ret.preferred | CUBEB_DEVICE_PREF_VOICE); }