From 44080154b017b42d0a502a17066be8b0383710e7 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Mon, 25 Dec 2023 16:15:33 -0800 Subject: [PATCH] no setenv on Windows Signed-off-by: Rosen Penev --- src/output/plugins/PulseOutputPlugin.cxx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/output/plugins/PulseOutputPlugin.cxx b/src/output/plugins/PulseOutputPlugin.cxx index 4f13c83f08..7b35b82718 100644 --- a/src/output/plugins/PulseOutputPlugin.cxx +++ b/src/output/plugins/PulseOutputPlugin.cxx @@ -23,6 +23,10 @@ #include +#ifdef _WIN32 +#include +#endif + #define MPD_PULSE_NAME "Music Player Daemon" class PulseOutput final : AudioOutput { @@ -175,8 +179,13 @@ PulseOutput::PulseOutput(const ConfigBlock &block) sink(block.GetBlockValue("sink")), media_role(block.GetBlockValue("media_role")) { +#ifdef _WIN32 + SetEnvironmentVariableA("PULSE_PROP_media.role", "music"); + SetEnvironmentVariableA("PULSE_PROP_application.icon_name", "mpd"); +#else setenv("PULSE_PROP_media.role", "music", true); setenv("PULSE_PROP_application.icon_name", "mpd", true); +#endif } struct pa_threaded_mainloop *