aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/output_init.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/output_init.c b/src/output_init.c
index 04609bb76..d72893ba8 100644
--- a/src/output_init.c
+++ b/src/output_init.c
@@ -56,6 +56,19 @@ audio_output_detect(GError **error)
return NULL;
}
+static struct mixer *
+audio_output_load_mixer(const struct config_param *param,
+ const struct mixer_plugin *plugin)
+{
+ if (!config_get_block_bool(param, "mixer_enabled", true))
+ return NULL;
+
+ if (plugin == NULL)
+ return NULL;
+
+ return mixer_new(plugin, param);
+}
+
bool
audio_output_init(struct audio_output *ao, const struct config_param *param,
GError **error)
@@ -135,11 +148,7 @@ audio_output_init(struct audio_output *ao, const struct config_param *param,
if (ao->data == NULL)
return false;
- if (plugin->mixer_plugin != NULL &&
- config_get_block_bool(param, "mixer_enabled", true))
- ao->mixer = mixer_new(plugin->mixer_plugin, param);
- else
- ao->mixer = NULL;
+ ao->mixer = audio_output_load_mixer(param, plugin->mixer_plugin);
return true;
}