aboutsummaryrefslogtreecommitdiffstats
path: root/src/output/Init.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-01-28 23:39:48 +0100
committerMax Kellermann <max@duempel.org>2014-01-29 08:10:18 +0100
commitbf803e241f4f1210e7ed1e71895a561de81d7a94 (patch)
treed9894df2da6ad9478d5459f7a2af0974bf5a4979 /src/output/Init.cxx
parent8a8d023f90e057ae9b70377a132f4259b173d436 (diff)
downloadmpd-bf803e241f4f1210e7ed1e71895a561de81d7a94.tar.gz
mpd-bf803e241f4f1210e7ed1e71895a561de81d7a94.tar.xz
mpd-bf803e241f4f1210e7ed1e71895a561de81d7a94.zip
AudioOutput: pass plugin to constructor
Make it "const".
Diffstat (limited to '')
-rw-r--r--src/output/Init.cxx16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/output/Init.cxx b/src/output/Init.cxx
index 52ff14b58..a4a22e33a 100644
--- a/src/output/Init.cxx
+++ b/src/output/Init.cxx
@@ -46,8 +46,9 @@
#define AUDIO_OUTPUT_FORMAT "format"
#define AUDIO_FILTERS "filters"
-AudioOutput::AudioOutput()
- :enabled(true), really_enabled(false),
+AudioOutput::AudioOutput(const AudioOutputPlugin &_plugin)
+ :plugin(&_plugin),
+ enabled(true), really_enabled(false),
open(false),
pause(false),
allow_play(true),
@@ -58,6 +59,10 @@ AudioOutput::AudioOutput()
other_replay_gain_filter(nullptr),
command(AO_COMMAND_NONE)
{
+ assert(plugin->finish != nullptr);
+ assert(plugin->open != nullptr);
+ assert(plugin->close != nullptr);
+ assert(plugin->play != nullptr);
}
static const AudioOutputPlugin *
@@ -143,15 +148,9 @@ audio_output_load_mixer(AudioOutput *ao,
bool
ao_base_init(AudioOutput *ao,
- const AudioOutputPlugin *plugin,
const config_param &param, Error &error)
{
assert(ao != nullptr);
- assert(plugin != nullptr);
- assert(plugin->finish != nullptr);
- assert(plugin->open != nullptr);
- assert(plugin->close != nullptr);
- assert(plugin->play != nullptr);
if (!param.IsNull()) {
ao->name = param.GetBlockValue(AUDIO_OUTPUT_NAME);
@@ -176,7 +175,6 @@ ao_base_init(AudioOutput *ao,
ao->config_audio_format.Clear();
}
- ao->plugin = plugin;
ao->tags = param.GetBlockValue("tags", true);
ao->always_on = param.GetBlockValue("always_on", false);
ao->enabled = param.GetBlockValue("enabled", true);