From d0aa154ea6f842fd03eeebabad015ef0872d9d37 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 9 Nov 2016 12:03:20 +0100 Subject: [PATCH] output/null: migrate from class Error to C++ exceptions --- src/output/plugins/NullOutputPlugin.cxx | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/src/output/plugins/NullOutputPlugin.cxx b/src/output/plugins/NullOutputPlugin.cxx index 308ed2700..601fc1039 100644 --- a/src/output/plugins/NullOutputPlugin.cxx +++ b/src/output/plugins/NullOutputPlugin.cxx @@ -28,17 +28,14 @@ class NullOutput { AudioOutput base; - bool sync; + const bool sync; Timer *timer; public: - NullOutput() - :base(null_output_plugin) {} - - bool Initialize(const ConfigBlock &block, Error &error) { - return base.Configure(block, error); - } + NullOutput(const ConfigBlock &block) + :base(null_output_plugin, block), + sync(block.GetBlockValue("sync", true)) {} static NullOutput *Create(const ConfigBlock &block, Error &error); @@ -78,18 +75,9 @@ public: }; inline NullOutput * -NullOutput::Create(const ConfigBlock &block, Error &error) +NullOutput::Create(const ConfigBlock &block, Error &) { - NullOutput *nd = new NullOutput(); - - if (!nd->Initialize(block, error)) { - delete nd; - return nullptr; - } - - nd->sync = block.GetBlockValue("sync", true); - - return nd; + return new NullOutput(block); } typedef AudioOutputWrapper Wrapper;