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.
This commit is contained in:
Tanu Kaskinen 2012-11-16 18:24:34 +02:00
parent 28c49a12fc
commit 0f44b1e820
12 changed files with 76 additions and 25 deletions

View file

@ -949,6 +949,9 @@ static int esd_proto_standby_or_resume(connection *c, esd_proto_t request, const
connection_write_prepare(c, sizeof(int32_t) * 2);
connection_write(c, &ok, sizeof(int32_t));
pa_log_debug("%s of all sinks and sources requested by client %" PRIu32 ".",
request == ESD_PROTO_STANDBY ? "Suspending" : "Resuming", c->client->index);
if (request == ESD_PROTO_STANDBY) {
ok = pa_sink_suspend_all(c->protocol->core, true, PA_SUSPEND_USER) >= 0;
ok &= pa_source_suspend_all(c->protocol->core, true, PA_SUSPEND_USER) >= 0;