From 5eef7a039c8a28b6ff4cb1dd4ea17c2112c87e86 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 12 Jan 2009 19:44:21 +0100 Subject: 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. --- src/pulsecore/protocol-native.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/pulsecore/protocol-native.c') 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; -- cgit