diff options
author | Max Kellermann <max@duempel.org> | 2013-12-31 16:55:26 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-12-31 16:55:26 +0100 |
commit | 964b2661d854897d91484b89537a6f29b6403e4b (patch) | |
tree | e04db63856f7291925b1bfd609244890da3cac40 /src/output/HttpdOutputPlugin.cxx | |
parent | 8b65b524d50590db13818affdcc6ceffa4c23d19 (diff) | |
download | mpd-964b2661d854897d91484b89537a6f29b6403e4b.tar.gz mpd-964b2661d854897d91484b89537a6f29b6403e4b.tar.xz mpd-964b2661d854897d91484b89537a6f29b6403e4b.zip |
output/httpd: add methods Init(), Finish()
Diffstat (limited to 'src/output/HttpdOutputPlugin.cxx')
-rw-r--r-- | src/output/HttpdOutputPlugin.cxx | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/output/HttpdOutputPlugin.cxx b/src/output/HttpdOutputPlugin.cxx index b2c7de518..3acf53bb8 100644 --- a/src/output/HttpdOutputPlugin.cxx +++ b/src/output/HttpdOutputPlugin.cxx @@ -128,24 +128,22 @@ HttpdOutput::Configure(const config_param ¶m, Error &error) return true; } +inline bool +HttpdOutput::Init(const config_param ¶m, Error &error) +{ + return ao_base_init(&base, &httpd_output_plugin, param, error); +} + static struct audio_output * httpd_output_init(const config_param ¶m, Error &error) { HttpdOutput *httpd = new HttpdOutput(*main_loop); - if (!ao_base_init(&httpd->base, &httpd_output_plugin, param, - error)) { - delete httpd; - return nullptr; - } - - if (!httpd->Configure(param, error)) { - ao_base_finish(&httpd->base); + audio_output *result = httpd->InitAndConfigure(param, error); + if (result == nullptr) delete httpd; - return nullptr; - } - return &httpd->base; + return result; } #if GCC_CHECK_VERSION(4,6) || defined(__clang__) @@ -168,7 +166,7 @@ httpd_output_finish(struct audio_output *ao) { HttpdOutput *httpd = Cast(ao); - ao_base_finish(&httpd->base); + httpd->Finish(); delete httpd; } |