From 0f44b1e820c1744bfb46d37e87b71d64109c4374 Mon Sep 17 00:00:00 2001 From: Tanu Kaskinen Date: Fri, 16 Nov 2012 18:24:34 +0200 Subject: Log the reason for every suspend/resume. I was looking at a log that showed that a suspend happened (at a strange time), but the log didn't tell me why the suspend was done. This patch tries to make sure that that won't happen again. --- src/pulsecore/protocol-native.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/pulsecore/protocol-native.c') diff --git a/src/pulsecore/protocol-native.c b/src/pulsecore/protocol-native.c index c39efc6f0..88808bf84 100644 --- a/src/pulsecore/protocol-native.c +++ b/src/pulsecore/protocol-native.c @@ -4552,6 +4552,9 @@ static void command_suspend(pa_pdispatch *pd, uint32_t command, uint32_t tag, pa CHECK_VALIDITY(c->pstream, sink, tag, PA_ERR_NOENTITY); + pa_log_debug("%s of sink %s requested by client %" PRIu32 ".", + b ? "Suspending" : "Resuming", sink->name, c->client->index); + if (pa_sink_suspend(sink, b, PA_SUSPEND_USER) < 0) { pa_pstream_send_error(c->pstream, tag, PA_ERR_INVALID); return; @@ -4580,6 +4583,9 @@ static void command_suspend(pa_pdispatch *pd, uint32_t command, uint32_t tag, pa CHECK_VALIDITY(c->pstream, source, tag, PA_ERR_NOENTITY); + pa_log_debug("%s of source %s requested by client %" PRIu32 ".", + b ? "Suspending" : "Resuming", source->name, c->client->index); + if (pa_source_suspend(source, b, PA_SUSPEND_USER) < 0) { pa_pstream_send_error(c->pstream, tag, PA_ERR_INVALID); return; -- cgit v1.2.3