aboutsummaryrefslogtreecommitdiffstats
path: root/src/mixer_api.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-01-25 17:37:55 +0100
committerMax Kellermann <max@duempel.org>2009-01-25 17:37:55 +0100
commit763dd8c1dd4de451663474bafd13068eb6017bbb (patch)
tree04d25b3107b170987ba6b2b1340f313a760c2e05 /src/mixer_api.c
parentad8561bfdc76d05812efc7fa802df48c37fcf770 (diff)
downloadmpd-763dd8c1dd4de451663474bafd13068eb6017bbb.tar.gz
mpd-763dd8c1dd4de451663474bafd13068eb6017bbb.tar.xz
mpd-763dd8c1dd4de451663474bafd13068eb6017bbb.zip
mixer: return a mixer struct pointer
Don't use statically allocated mixer objects.
Diffstat (limited to '')
-rw-r--r--src/mixer_api.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/mixer_api.c b/src/mixer_api.c
index bd5e1ca05..cd216415a 100644
--- a/src/mixer_api.c
+++ b/src/mixer_api.c
@@ -37,6 +37,22 @@ void mixer_finish(struct mixer *mixer)
mixer->plugin = NULL;
}
+struct mixer *
+mixer_new(const struct mixer_plugin *plugin)
+{
+ struct mixer *mixer = g_new(struct mixer, 1);
+
+ mixer_init(mixer, plugin);
+ return mixer;
+}
+
+void
+mixer_free(struct mixer *mixer)
+{
+ mixer_finish(mixer);
+ g_free(mixer);
+}
+
void mixer_configure(struct mixer *mixer, const struct config_param *param)
{
assert(mixer != NULL && mixer->plugin != NULL);