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:
parent
91f3370913
commit
0ad56e0f8e
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue