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>
This commit is contained in:
David Guibert 2009-03-16 22:45:13 +01:00 committed by Max Kellermann
parent 91f3370913
commit 0ad56e0f8e
1 changed files with 14 additions and 1 deletions

View File

@ -236,7 +236,20 @@ pulse_mixer_open(G_GNUC_UNUSED struct mixer *data)
static void static void
pulse_mixer_close(G_GNUC_UNUSED struct mixer *data) 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 static int