sink, source: Call sink input suspend callback also on suspend cause change
authorGeorg Chini <georg@chini.tk>
Tue, 12 Feb 2019 19:21:01 +0000 (20:21 +0100)
committerArun Raghavan <arun@arunraghavan.net>
Mon, 25 Mar 2019 05:16:15 +0000 (05:16 +0000)
commitacb02d9e88ff341045ad00eb9d8fbccfb5f302ae
tree92ce19d6256e2854cb2e14624d41233083450048
parentf7b3537bbf9a6916ee3fd72a82025519b4c346f5
sink, source: Call sink input suspend callback also on suspend cause change

Currently, virtual sinks and sources are not suspended when the master sink
or source is suspended. To implement this, the slave must be able to track
the suspend cause of the master.

With this patch, the sink input suspend callback will not only be called
when the sink or source is changing state, but also when the suspend cause
changes. Similar to the set_state_in_*_thread_cb() functions, the suspend
callback receives a state and a suspend cause as additional arguments.
Because the new state and suspend cause of the sink or source have already
been set, the old values are passed to the callback.
src/modules/module-loopback.c
src/pulsecore/protocol-native.c
src/pulsecore/sink-input.h
src/pulsecore/sink.c
src/pulsecore/source-output.h
src/pulsecore/source.c