suspend-on-idle: use earlier (safer) hooks for stream unlink notifications
authorTanu Kaskinen <tanuk@iki.fi>
Wed, 12 Oct 2016 14:20:40 +0000 (17:20 +0300)
committerTanu Kaskinen <tanuk@iki.fi>
Mon, 19 Dec 2016 23:26:41 +0000 (01:26 +0200)
commitc3393d27a5b18bca3e052d54a734d5cfb9e0aea0
tree27a6d3c14edcf4fc25b8632f2e7d03fecc0ce44b
parent2250dbfd6968bd9ce295fc7bef8595b2c6ef6a44
suspend-on-idle: use earlier (safer) hooks for stream unlink notifications

In the "unlink post" hook it's not guaranteed that the stream's old
device exists any more, so let's use the "unlink" hook that is safer.
For example, module-bluetooth-policy does a card profile change in the
source-output "unlink post" hook, which invalidates the source-output's
source pointer.

When the "unlink" hook is fired, the stream is still linked to its
device, which affects the return values of the check_suspend()
functions. The unlinked streams should be ignored by the check_suspend()
functions, so I had to add extra parameters to those functions.
src/modules/module-suspend-on-idle.c
src/pulsecore/sink.c
src/pulsecore/sink.h
src/pulsecore/source.c
src/pulsecore/source.h