aboutsummaryrefslogtreecommitdiffstats
path: root/src/output/HttpdInternal.hxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-12-31 16:55:26 +0100
committerMax Kellermann <max@duempel.org>2013-12-31 16:55:26 +0100
commit964b2661d854897d91484b89537a6f29b6403e4b (patch)
treee04db63856f7291925b1bfd609244890da3cac40 /src/output/HttpdInternal.hxx
parent8b65b524d50590db13818affdcc6ceffa4c23d19 (diff)
downloadmpd-964b2661d854897d91484b89537a6f29b6403e4b.tar.gz
mpd-964b2661d854897d91484b89537a6f29b6403e4b.tar.xz
mpd-964b2661d854897d91484b89537a6f29b6403e4b.zip
output/httpd: add methods Init(), Finish()
Diffstat (limited to '')
-rw-r--r--src/output/HttpdInternal.hxx19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/output/HttpdInternal.hxx b/src/output/HttpdInternal.hxx
index b76493a44..ba8c9a5b6 100644
--- a/src/output/HttpdInternal.hxx
+++ b/src/output/HttpdInternal.hxx
@@ -129,8 +129,27 @@ struct HttpdOutput final : private ServerSocket {
HttpdOutput(EventLoop &_loop);
~HttpdOutput();
+ bool Init(const config_param &param, Error &error);
+
+ void Finish() {
+ ao_base_finish(&base);
+ }
+
bool Configure(const config_param &param, Error &error);
+ audio_output *InitAndConfigure(const config_param &param,
+ Error &error) {
+ if (!Init(param, error))
+ return nullptr;
+
+ if (!Configure(param, error)) {
+ Finish();
+ return nullptr;
+ }
+
+ return &base;
+ }
+
bool Bind(Error &error);
void Unbind();