[pulseaudio-commits] src/modules

Tanu Kaskinen tanuk at kemper.freedesktop.org
Fri Jan 20 10:05:02 UTC 2017


 src/modules/module-suspend-on-idle.c |   14 ++++++++++++++
 1 file changed, 14 insertions(+)

New commits:
commit d442da3a09bb5c01881184f257dff110097631c3
Author: Wim Taymans <wtaymans at redhat.com>
Date:   Wed Jan 11 12:50:13 2017 +0100

    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.

diff --git a/src/modules/module-suspend-on-idle.c b/src/modules/module-suspend-on-idle.c
index a284f85..268f0ae 100644
--- a/src/modules/module-suspend-on-idle.c
+++ b/src/modules/module-suspend-on-idle.c
@@ -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);



More information about the pulseaudio-commits mailing list