The hooks are fired when the preferred device changes. This is useful for module-stream-restore.
I added new set_preferred_sink/source() functions for firing the hooks. The functions also log the preferred device changes.
There was already pa_sink_input_set_preferred_sink(), but that had a side effect of moving the stream, so I needed a new function. Since it can be confusing when the two similarly named functions should be called, I added a comment for pa_sink_input_set_preferred_sink() that explains the different situations.
737ebcdfd sink-input, source-output: Add hooks for preferred device changes
src/pulsecore/core.h | 2 ++
src/pulsecore/sink-input.c | 42 +++++++++++++++++++++++++++++++++++-------
src/pulsecore/source-output.c | 42 +++++++++++++++++++++++++++++++++++-------
3 files changed, 72 insertions(+), 14 deletions(-)