diff options
-rw-r--r-- | src/output/plugins/PipeOutputPlugin.cxx | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/output/plugins/PipeOutputPlugin.cxx b/src/output/plugins/PipeOutputPlugin.cxx index 1be5340e8..e518a0115 100644 --- a/src/output/plugins/PipeOutputPlugin.cxx +++ b/src/output/plugins/PipeOutputPlugin.cxx @@ -39,6 +39,8 @@ struct PipeOutput { bool Configure(const config_param ¶m, Error &error); + static AudioOutput *Create(const config_param ¶m, Error &error); + bool Open(AudioFormat &audio_format, Error &error); void Close() { @@ -67,17 +69,23 @@ PipeOutput::Configure(const config_param ¶m, Error &error) return true; } -static AudioOutput * -pipe_output_init(const config_param ¶m, Error &error) +inline AudioOutput * +PipeOutput::Create(const config_param ¶m, Error &error) { - PipeOutput *pd = new PipeOutput(); + PipeOutput *po = new PipeOutput(); - if (!pd->Configure(param, error)) { - delete pd; + if (!po->Configure(param, error)) { + delete po; return nullptr; } - return &pd->base; + return &po->base; +} + +static AudioOutput * +pipe_output_init(const config_param ¶m, Error &error) +{ + return PipeOutput::Create(param, error); } static void |