mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-01 22:58:47 -04:00
suspend-on-idle: resume on unload
We need to resume all sinks we know about when unloading the module or else they will stay suspended forever.
This commit is contained in:
parent
b365d7e60c
commit
d442da3a09
1 changed files with 14 additions and 0 deletions
|
|
@ -476,6 +476,8 @@ fail:
|
||||||
|
|
||||||
void pa__done(pa_module*m) {
|
void pa__done(pa_module*m) {
|
||||||
struct userdata *u;
|
struct userdata *u;
|
||||||
|
struct device_info *d;
|
||||||
|
void *state;
|
||||||
|
|
||||||
pa_assert(m);
|
pa_assert(m);
|
||||||
|
|
||||||
|
|
@ -484,6 +486,18 @@ void pa__done(pa_module*m) {
|
||||||
|
|
||||||
u = m->userdata;
|
u = m->userdata;
|
||||||
|
|
||||||
|
PA_HASHMAP_FOREACH(d, u->device_infos, state) {
|
||||||
|
if (d->sink && pa_sink_get_state(d->sink) == PA_SINK_SUSPENDED) {
|
||||||
|
pa_log_debug("Resuming sink %s on module unload.", d->sink->name);
|
||||||
|
pa_sink_suspend(d->sink, false, PA_SUSPEND_IDLE);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (d->source && pa_source_get_state(d->source) == PA_SOURCE_SUSPENDED) {
|
||||||
|
pa_log_debug("Resuming source %s on module unload.", d->source->name);
|
||||||
|
pa_source_suspend(d->source, false, PA_SUSPEND_IDLE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pa_hashmap_free(u->device_infos);
|
pa_hashmap_free(u->device_infos);
|
||||||
|
|
||||||
pa_xfree(u);
|
pa_xfree(u);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue