[gnome-boxes/fallback-to-spice-in-non-flatpak] vm-configurator: Use PulseAudio for Flatpak and SPICE for others




commit f09a4482278f1d569a070fe3424ed7ffb4b15a8c
Author: Felipe Borges <felipeborges gnome org>
Date:   Thu Dec 2 14:37:12 2021 +0100

    vm-configurator: Use PulseAudio for Flatpak and SPICE for others
    
    We can't guarantee the host setup, so let's fallback to SPICE for
    non-Flatpak builds. It doesn't perform as well as the other backends
    but it will likely work everywhere.
    
    Fixes #738

 src/vm-configurator.vala | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/src/vm-configurator.vala b/src/vm-configurator.vala
index 27554b24..89dc7198 100644
--- a/src/vm-configurator.vala
+++ b/src/vm-configurator.vala
@@ -278,9 +278,13 @@ public static async void update_existing_domain (Domain          domain,
             if (device_xml.has_prefix ("<audio") && device_xml.contains ("none")) {
                 debug ("Fixing audio for %s\n", domain.name);
 
+                #if FLATPAK
                 var server_name = Path.build_filename (Environment.get_user_runtime_dir (), "pulse", 
"native");
                 var fixed_audio_xml = device_xml.replace ("none\"",
                                                           "pulseaudio\" serverName=\"%s\"".printf 
(server_name));
+                #else
+                var fixed_audio_xml = device_xml.replace ("none", "spice");
+                #endif
 
                 var audio_device = new GVirConfig.Object.from_xml (typeof (DomainDevice), "audio", "", 
fixed_audio_xml);
                 devices.prepend (audio_device as DomainDevice);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]