summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2009-01-12 19:44:21 +0100
committerLennart Poettering <lennart@poettering.net>2009-01-12 20:37:28 +0100
commit5eef7a039c8a28b6ff4cb1dd4ea17c2112c87e86 (patch)
tree32ce2db0b5517dc75a088f9d03f854312b4df710
parent6d12f81d500a68a205e69071d6c5d4cf15d5f031 (diff)
Fix suspending of all sinks/sources
pasuspender issues a SUSPEND_ALL requests for suspending all sinks/sources at once. This has been broken due to an ill-placed sanity checked.
-rw-r--r--src/pulsecore/protocol-native.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/pulsecore/protocol-native.c b/src/pulsecore/protocol-native.c
index 778aab57..0d1a520a 100644
--- a/src/pulsecore/protocol-native.c
+++ b/src/pulsecore/protocol-native.c
@@ -3933,7 +3933,7 @@ static void command_suspend(pa_pdispatch *pd, uint32_t command, uint32_t tag, pa
}
CHECK_VALIDITY(c->pstream, c->authorized, tag, PA_ERR_ACCESS);
- CHECK_VALIDITY(c->pstream, !name || pa_namereg_is_valid_name(name), tag, PA_ERR_INVALID);
+ CHECK_VALIDITY(c->pstream, !name || pa_namereg_is_valid_name(name) || *name == 0, tag, PA_ERR_INVALID);
CHECK_VALIDITY(c->pstream, idx != PA_INVALID_INDEX || name, tag, PA_ERR_INVALID);
CHECK_VALIDITY(c->pstream, idx == PA_INVALID_INDEX || !name, tag, PA_ERR_INVALID);
CHECK_VALIDITY(c->pstream, !name || idx == PA_INVALID_INDEX, tag, PA_ERR_INVALID);
@@ -3942,6 +3942,8 @@ static void command_suspend(pa_pdispatch *pd, uint32_t command, uint32_t tag, pa
if (idx == PA_INVALID_INDEX && name && !*name) {
+ pa_log_debug("%s all sinks", b ? "Suspending" : "Resuming");
+
if (pa_sink_suspend_all(c->protocol->core, b) < 0) {
pa_pstream_send_error(c->pstream, tag, PA_ERR_INVALID);
return;
@@ -3967,6 +3969,8 @@ static void command_suspend(pa_pdispatch *pd, uint32_t command, uint32_t tag, pa
if (idx == PA_INVALID_INDEX && name && !*name) {
+ pa_log_debug("%s all sources", b ? "Suspending" : "Resuming");
+
if (pa_source_suspend_all(c->protocol->core, b) < 0) {
pa_pstream_send_error(c->pstream, tag, PA_ERR_INVALID);
return;