aboutsummaryrefslogtreecommitdiffstats
path: root/src/output_finish.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2011-09-16 23:31:48 +0200
committerMax Kellermann <max@duempel.org>2011-09-19 09:41:21 +0200
commit74617389c88ccf630b8cce4b54d9e2fa5afb2259 (patch)
tree3d05faad2c2b3b2e9e885f2c391a35fe8f06553a /src/output_finish.c
parentb4a8b8c0d4bf82fc56572c3f8e79108d22d78132 (diff)
downloadmpd-74617389c88ccf630b8cce4b54d9e2fa5afb2259.tar.gz
mpd-74617389c88ccf630b8cce4b54d9e2fa5afb2259.tar.xz
mpd-74617389c88ccf630b8cce4b54d9e2fa5afb2259.zip
output_plugin: the plugin allocates the audio_output object
Pass audio_output objects around instead of void pointers. This will give some more control to the plugin, and prepares for non-blocking audio outputs.
Diffstat (limited to 'src/output_finish.c')
-rw-r--r--src/output_finish.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/output_finish.c b/src/output_finish.c
index ac7f7e0c2..e11b43675 100644
--- a/src/output_finish.c
+++ b/src/output_finish.c
@@ -26,7 +26,7 @@
#include <assert.h>
void
-audio_output_destruct(struct audio_output *ao)
+ao_base_finish(struct audio_output *ao)
{
assert(!ao->open);
assert(ao->fail_timer == NULL);
@@ -35,8 +35,6 @@ audio_output_destruct(struct audio_output *ao)
if (ao->mixer != NULL)
mixer_free(ao->mixer);
- ao_plugin_finish(ao->plugin, ao->data);
-
g_cond_free(ao->cond);
g_mutex_free(ao->mutex);
@@ -50,3 +48,13 @@ audio_output_destruct(struct audio_output *ao)
pcm_buffer_deinit(&ao->cross_fade_buffer);
}
+
+void
+audio_output_free(struct audio_output *ao)
+{
+ assert(!ao->open);
+ assert(ao->fail_timer == NULL);
+ assert(ao->thread == NULL);
+
+ ao_plugin_finish(ao);
+}