pulse_mixer: initialize "online" and "index" in open()
The attributes "online" and "index" were not properly reinitialized after a close/open cycle.
This commit is contained in:
parent
52575d1b9d
commit
8cf206f2ee
@ -165,7 +165,6 @@ pulse_mixer_init(const struct config_param *param)
|
|||||||
pm->mainloop=NULL;
|
pm->mainloop=NULL;
|
||||||
pm->volume=NULL;
|
pm->volume=NULL;
|
||||||
pm->output_name=NULL;
|
pm->output_name=NULL;
|
||||||
pm->index=0;
|
|
||||||
pm->online=false;
|
pm->online=false;
|
||||||
|
|
||||||
pm->volume = g_new(struct pa_cvolume,1);
|
pm->volume = g_new(struct pa_cvolume,1);
|
||||||
@ -184,7 +183,6 @@ pulse_mixer_finish(struct mixer *data)
|
|||||||
pm->context = NULL;
|
pm->context = NULL;
|
||||||
pm->mainloop = NULL;
|
pm->mainloop = NULL;
|
||||||
pm->volume = NULL;
|
pm->volume = NULL;
|
||||||
pm->online = false;
|
|
||||||
g_free(pm);
|
g_free(pm);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -226,6 +224,9 @@ pulse_mixer_open(G_GNUC_UNUSED struct mixer *data)
|
|||||||
struct pulse_mixer *pm = (struct pulse_mixer *) data;
|
struct pulse_mixer *pm = (struct pulse_mixer *) data;
|
||||||
g_debug("pulse mixer open");
|
g_debug("pulse mixer open");
|
||||||
|
|
||||||
|
pm->index = 0;
|
||||||
|
pm->online = false;
|
||||||
|
|
||||||
if(!(pm->mainloop = pa_threaded_mainloop_new())) {
|
if(!(pm->mainloop = pa_threaded_mainloop_new())) {
|
||||||
g_debug("failed mainloop");
|
g_debug("failed mainloop");
|
||||||
return false;
|
return false;
|
||||||
@ -267,6 +268,8 @@ pulse_mixer_close(G_GNUC_UNUSED struct mixer *data)
|
|||||||
pa_threaded_mainloop_free(pm->mainloop);
|
pa_threaded_mainloop_free(pm->mainloop);
|
||||||
pm->mainloop = NULL;
|
pm->mainloop = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pm->online = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
Loading…
Reference in New Issue
Block a user