output_init: moved mixer instantiation to separate function
This commit is contained in:
parent
86e279f886
commit
d78be1ab49
@ -56,6 +56,19 @@ audio_output_detect(GError **error)
|
|||||||
return NULL;
|
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
|
bool
|
||||||
audio_output_init(struct audio_output *ao, const struct config_param *param,
|
audio_output_init(struct audio_output *ao, const struct config_param *param,
|
||||||
GError **error)
|
GError **error)
|
||||||
@ -135,11 +148,7 @@ audio_output_init(struct audio_output *ao, const struct config_param *param,
|
|||||||
if (ao->data == NULL)
|
if (ao->data == NULL)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (plugin->mixer_plugin != NULL &&
|
ao->mixer = audio_output_load_mixer(param, plugin->mixer_plugin);
|
||||||
config_get_block_bool(param, "mixer_enabled", true))
|
|
||||||
ao->mixer = mixer_new(plugin->mixer_plugin, param);
|
|
||||||
else
|
|
||||||
ao->mixer = NULL;
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user