From 064541dd2bc1f0813beaa8de24f37bc4ed100a04 Mon Sep 17 00:00:00 2001 From: LAGonauta Date: Sun, 9 May 2021 10:41:16 -0300 Subject: [PATCH] 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. --- plugins/rtp/src/plugin.vala | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/plugins/rtp/src/plugin.vala b/plugins/rtp/src/plugin.vala index 19a266b1..9e59a03b 100644 --- a/plugins/rtp/src/plugin.vala +++ b/plugins/rtp/src/plugin.vala @@ -326,6 +326,14 @@ public class Dino.Plugins.Rtp.Plugin : RootInterface, VideoCallPlugin, Object { bool right_is_default = false; 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 if (left_is_pipewire && !right_is_pipewire) return -1; if (right_is_pipewire && !left_is_pipewire) return 1;