summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2007-08-16 18:26:35 +0000
committerLennart Poettering <lennart@poettering.net>2007-08-16 18:26:35 +0000
commit843dcceb1d9884fd677846f0a556671e9417235c (patch)
tree46264e9a6393eac27faf31d7f547945fc8552f2c
parent39d1e653387e9c139cfaa69820b2925234356b2a (diff)
only suspend device when server is local
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1675 fefdeb5f-60dc-0310-8127-8f9354f1896f
-rw-r--r--src/utils/pasuspender.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/utils/pasuspender.c b/src/utils/pasuspender.c
index 9ffd6d63..a546f9a4 100644
--- a/src/utils/pasuspender.c
+++ b/src/utils/pasuspender.c
@@ -143,8 +143,12 @@ static void context_state_callback(pa_context *c, void *userdata) {
break;
case PA_CONTEXT_READY:
- pa_operation_unref(pa_context_suspend_sink_by_index(c, PA_INVALID_INDEX, 1, suspend_complete, NULL));
- pa_operation_unref(pa_context_suspend_source_by_index(c, PA_INVALID_INDEX, 1, suspend_complete, NULL));
+ if (pa_context_is_local(c)) {
+ pa_operation_unref(pa_context_suspend_sink_by_index(c, PA_INVALID_INDEX, 1, suspend_complete, NULL));
+ pa_operation_unref(pa_context_suspend_source_by_index(c, PA_INVALID_INDEX, 1, suspend_complete, NULL));
+ } else
+ start_child();
+
break;
case PA_CONTEXT_TERMINATED:
@@ -193,9 +197,12 @@ static void sigchld_callback(pa_mainloop_api *m, pa_signal_event *e, int sig, vo
}
if (context) {
- /* A context is around, so let's resume */
- pa_operation_unref(pa_context_suspend_sink_by_index(context, PA_INVALID_INDEX, 0, resume_complete, NULL));
- pa_operation_unref(pa_context_suspend_source_by_index(context, PA_INVALID_INDEX, 0, resume_complete, NULL));
+ if (pa_context_is_local(context)) {
+ /* A context is around, so let's resume */
+ pa_operation_unref(pa_context_suspend_sink_by_index(context, PA_INVALID_INDEX, 0, resume_complete, NULL));
+ pa_operation_unref(pa_context_suspend_source_by_index(context, PA_INVALID_INDEX, 0, resume_complete, NULL));
+ } else
+ drain();
} else
/* Hmm, no context here, so let's terminate right away */
quit(0);