diff options
author | Alexander Sulfrian <alexander@sulfrian.net> | 2013-06-19 22:06:56 +0200 |
---|---|---|
committer | Alexander Sulfrian <alexander@sulfrian.net> | 2015-12-04 23:52:53 +0100 |
commit | dd39ddc44787551c78c604bd671ccaec5b438de8 (patch) | |
tree | 3febbb6f2babc09b3efc9c9debdbed838c98fd3f | |
parent | 019aea3d63f58e5a7ee2718f12723e0f5f4e22e5 (diff) | |
download | mpd-custom-cookie-path.tar.gz mpd-custom-cookie-path.tar.xz mpd-custom-cookie-path.zip |
output/pulse: Add possibility to set custom cookie path per outputcustom-cookie-path
Diffstat (limited to '')
-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; } |