mixer: return a mixer struct pointer

Don't use statically allocated mixer objects.
This commit is contained in:
Max Kellermann
2009-01-25 17:37:55 +01:00
parent ad8561bfdc
commit 763dd8c1dd
4 changed files with 40 additions and 15 deletions

View File

@@ -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);