wasapi: Fix default device handling.
Some checks failed
Build / build (macos-13, Debug) (push) Has been cancelled
Build / build (macos-13, Release) (push) Has been cancelled
Build / build (macos-14, Debug) (push) Has been cancelled
Build / build (macos-14, Release) (push) Has been cancelled
Build / build (ubuntu-20.04, Debug) (push) Has been cancelled
Build / build (ubuntu-20.04, Release) (push) Has been cancelled
Build / build (windows-2019, Debug) (push) Has been cancelled
Build / build (windows-2019, Release) (push) Has been cancelled
Build / build-android (arm64-v8a, Debug) (push) Has been cancelled
Build / build-android (arm64-v8a, Release) (push) Has been cancelled
Build / build-android (armeabi-v7a, Debug) (push) Has been cancelled
Build / build-android (armeabi-v7a, Release) (push) Has been cancelled
Build / build-android (x86_64, Debug) (push) Has been cancelled
Build / build-android (x86_64, Release) (push) Has been cancelled
Build / check_format (push) Has been cancelled

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.
This commit is contained in:
Miriam Zimmerman 2024-08-30 15:52:03 -04:00 committed by Paul Adenot
parent 8f6c9a01dd
commit 19d2f7bce6

View file

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