Skip to content

Commit

Permalink
no setenv on Windows
Browse files Browse the repository at this point in the history
Signed-off-by: Rosen Penev <[email protected]>
  • Loading branch information
neheb committed Dec 27, 2023
1 parent c17493f commit 4408015
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/output/plugins/PulseOutputPlugin.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@

#include <stdlib.h>

#ifdef _WIN32
#include <processenv.h>
#endif

#define MPD_PULSE_NAME "Music Player Daemon"

class PulseOutput final : AudioOutput {
Expand Down Expand Up @@ -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 *
Expand Down

0 comments on commit 4408015

Please sign in to comment.