aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Guibert <david.guibert@gmail.com>2009-03-16 22:45:13 +0100
committerMax Kellermann <max@duempel.org>2009-03-17 08:40:50 +0100
commit0ad56e0f8e8ba3474d4a95cf9abe283d65b64ebb (patch)
tree2c6ac99c234f2643d85975f9a638118c1abe3e84
parent91f33709135bca4c050b0df1963c8d8bd98b3154 (diff)
downloadmpd-0ad56e0f8e8ba3474d4a95cf9abe283d65b64ebb.tar.gz
mpd-0ad56e0f8e8ba3474d4a95cf9abe283d65b64ebb.tar.xz
mpd-0ad56e0f8e8ba3474d4a95cf9abe283d65b64ebb.zip
pulse_mixer: close
when the mixer is closed, - the mainloop is stopped. - the context is disconnected. - then the mainloop is freed. Signed-off-by: David Guibert <david.guibert@gmail.com>
-rw-r--r--src/mixer/pulse_mixer.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/mixer/pulse_mixer.c b/src/mixer/pulse_mixer.c
index 5e4f294ba..5bb6061fe 100644
--- a/src/mixer/pulse_mixer.c
+++ b/src/mixer/pulse_mixer.c
@@ -236,7 +236,20 @@ pulse_mixer_open(G_GNUC_UNUSED struct mixer *data)
static void
pulse_mixer_close(G_GNUC_UNUSED struct mixer *data)
{
- return;
+ struct pulse_mixer *pm=(struct pulse_mixer *) data;
+ if (pm->mainloop)
+ pa_threaded_mainloop_stop(pm->mainloop);
+
+ if (pm->context) {
+ pa_context_disconnect(pm->context);
+ pa_context_unref(pm->context);
+ pm->context = NULL;
+ }
+
+ if (pm->mainloop) {
+ pa_threaded_mainloop_free(pm->mainloop);
+ pm->mainloop = NULL;
+ }
}
static int