diff options
Diffstat (limited to 'src/output/plugins/PulseOutputPlugin.cxx')
-rw-r--r-- | src/output/plugins/PulseOutputPlugin.cxx | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/output/plugins/PulseOutputPlugin.cxx b/src/output/plugins/PulseOutputPlugin.cxx index 8b5225584..f955e7e3b 100644 --- a/src/output/plugins/PulseOutputPlugin.cxx +++ b/src/output/plugins/PulseOutputPlugin.cxx @@ -50,6 +50,7 @@ class PulseOutput { const char *name; const char *server; const char *sink; + const char *cookie; PulseMixer *mixer; @@ -411,6 +412,11 @@ PulseOutput::SetupContext(Error &error) context = pa_context_new(pa_threaded_mainloop_get_api(mainloop), MPD_PULSE_NAME); + if (cookie != nullptr) { + FormatDefault(pulse_domain, "Loading cookie: %s", cookie); + pa_context_load_cookie_from_file(context, cookie); + } + if (context == nullptr) { error.Set(pulse_domain, "pa_context_new() has failed"); return false; @@ -438,6 +444,7 @@ PulseOutput::Configure(const ConfigBlock &block, Error &error) name = block.GetBlockValue("name", "mpd_pulse"); server = block.GetBlockValue("server"); sink = block.GetBlockValue("sink"); + sink = block.GetBlockValue("cookie"); return true; } |