sink, source: redo state changing code
authorTanu Kaskinen <tanuk@iki.fi>
Mon, 19 Feb 2018 14:48:22 +0000 (16:48 +0200)
committerTanu Kaskinen <tanuk@iki.fi>
Thu, 22 Feb 2018 07:09:25 +0000 (09:09 +0200)
commit3da0de5418b29c90974d0d3e2198c471c39d229f
tree2978360775c0b57017e2d3b355be0535e3991e56
parentbbab12ab340f74b8375426c1666853bfa79c2761
sink, source: redo state changing code

This adds a pa_suspend_cause_t parameter to the sink/source_set_state()
functions, and moves part of the work that pa_sink/source_suspend() does
to sink/source_set_state(). The reason for this code shuffling is that I
plan to make all suspend cause changes available to modules through the
state change callbacks. This is the first step towards that.

Additionally, pa_source_sync_suspend() is changed to also update the
suspend cause of the monitor source when the suspend cause of the
monitored sink changes. That probably doesn't have much effect on
anything, but I think it makes sense to mirror the sink suspend cause in
the monitor source.

pa_source_sync_suspend() has also a bug fix: previously it was probably
possible that a sink might get suspended while in the passthrough mode.
When the sink then resumed (while still in the passthrough mode),
pa_source_sync_suspend() would resume also the monitor source, even
though the monitor source should be kept suspended when the sink is in
the passthrough mode. Now the monitor source won't be resumed in this
situation.
src/pulsecore/sink.c
src/pulsecore/source.c