Prefer primary DirectSound device on Windows

It automatically selects the default device for use,
there is no book keeping necessary and things just work

The primary DirectSound device has a (NULL) guid, making
it wasy to be found.
This commit is contained in:
LAGonauta 2021-05-09 10:41:16 -03:00
parent 854818133e
commit 064541dd2b

View file

@ -326,6 +326,14 @@ public class Dino.Plugins.Rtp.Plugin : RootInterface, VideoCallPlugin, Object {
bool right_is_default = false; bool right_is_default = false;
right.device.properties.get_boolean("is-default", out right_is_default); right.device.properties.get_boolean("is-default", out right_is_default);
// default DirectSound device on Windows has (NULL) as guid
if (left.device.properties.get_string("device.guid") == "(NULL)") {
left_is_default = true;
}
if (right.device.properties.get_string("device.guid") == "(NULL)") {
right_is_default = true;
}
// Prefer pipewire // Prefer pipewire
if (left_is_pipewire && !right_is_pipewire) return -1; if (left_is_pipewire && !right_is_pipewire) return -1;
if (right_is_pipewire && !left_is_pipewire) return 1; if (right_is_pipewire && !left_is_pipewire) return 1;