aboutsummaryrefslogtreecommitdiffstats
path: root/src/mixer_api.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-01-25 17:38:12 +0100
committerMax Kellermann <max@duempel.org>2009-01-25 17:38:12 +0100
commitdc575106c296435940482cc2655804c71ee2d934 (patch)
tree4c5a455e28a224fdab697c4b00f34305b2e67281 /src/mixer_api.c
parentdb2058a26580681911aed09b427472ccde0176dd (diff)
downloadmpd-dc575106c296435940482cc2655804c71ee2d934.tar.gz
mpd-dc575106c296435940482cc2655804c71ee2d934.tar.xz
mpd-dc575106c296435940482cc2655804c71ee2d934.zip
mixer: merged methods "init" and "configure"
Both methods are always called together. There is no point in having them separate. This simplifies the code, because the old configure() method could be called more than once, and had to free old allocations.
Diffstat (limited to 'src/mixer_api.c')
-rw-r--r--src/mixer_api.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/mixer_api.c b/src/mixer_api.c
index b0fea9a7a..0cf4e0c92 100644
--- a/src/mixer_api.c
+++ b/src/mixer_api.c
@@ -21,14 +21,6 @@
#include "mixer_api.h"
-void mixer_init(struct mixer *mixer, const struct mixer_plugin *plugin)
-{
- assert(plugin != NULL);
- assert(mixer != NULL);
- mixer->plugin = plugin;
- mixer->data = mixer->plugin->init();
-}
-
void mixer_finish(struct mixer *mixer)
{
assert(mixer != NULL && mixer->plugin != NULL);
@@ -40,11 +32,13 @@ void mixer_finish(struct mixer *mixer)
struct mixer *
mixer_new(const struct mixer_plugin *plugin, const struct config_param *param)
{
- struct mixer *mixer = g_new(struct mixer, 1);
+ struct mixer *mixer;
- mixer_init(mixer, plugin);
- plugin->configure(mixer->data, param);
+ assert(plugin != NULL);
+ mixer = g_new(struct mixer, 1);
+ mixer->plugin = plugin;
+ mixer->data = mixer->plugin->init(param);
return mixer;
}