summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTanu Kaskinen <tanu.kaskinen@linux.intel.com>2014-03-03 16:21:21 +0200
committerTanu Kaskinen <tanu.kaskinen@linux.intel.com>2014-03-03 16:21:21 +0200
commit0a5adc95c46b7140e004fdd993181237f99c51d5 (patch)
treeb7aaa4f53b155f88b21550dcc4ef9c4349811ba9
parent2780f4c24f67a439eab19c47059d6ab2ed8836c3 (diff)
suspend-on-idle: Fix monitor source handlingv5.0
Fixes a crash that happened due to calling pa_source_check_suspend() when d->source was NULL.
-rw-r--r--src/modules/module-suspend-on-idle.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/modules/module-suspend-on-idle.c b/src/modules/module-suspend-on-idle.c
index 959de4324..15cbf95f0 100644
--- a/src/modules/module-suspend-on-idle.c
+++ b/src/modules/module-suspend-on-idle.c
@@ -167,8 +167,15 @@ static pa_hook_result_t source_output_fixate_hook_cb(pa_core *c, pa_source_outpu
if (d) {
resume(d);
- if (pa_source_check_suspend(d->source) <= 0)
- restart(d);
+ if (d->source) {
+ if (pa_source_check_suspend(d->source) <= 0)
+ restart(d);
+ } else {
+ /* The source output is connected to a monitor source. */
+ pa_assert(d->sink);
+ if (pa_sink_check_suspend(d->sink) <= 0)
+ restart(d);
+ }
}
return PA_HOOK_OK;