Commit d442da3a authored by Wim Taymans's avatar Wim Taymans Committed by Tanu Kaskinen

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.
parent b365d7e6
......@@ -476,6 +476,8 @@ fail:
void pa__done(pa_module*m) {
struct userdata *u;
struct device_info *d;
void *state;
pa_assert(m);
......@@ -484,6 +486,18 @@ void pa__done(pa_module*m) {
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_xfree(u);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment