sink-input, source-output: Add hooks for preferred device changes

System Internals / PulseAudio - Tanu Kaskinen [iki.fi] - 5 April 2021 15:17 UTC

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.

Part-of:

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(-)

Upstream: cgit.freedesktop.org


  • Share