sink, source: redo state changing code 66/178066/1
authorTanu Kaskinen <tanuk@iki.fi>
Mon, 19 Feb 2018 14:48:22 +0000 (16:48 +0200)
committerSangchul Lee <sc11.lee@samsung.com>
Tue, 8 May 2018 03:36:20 +0000 (12:36 +0900)
commit3d610c101b2eb63b159ff2ed7fcf6a4a382f00f9
treeb1090ba58240d29c5e273d6ceadf8050f08e28e3
parent77d3beb0ee82b0db15f81a8c73ab15be61f50aae
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.

Change-Id: Ibdfd913c2f8cab1c27e63cbb45ffd63c27936ce0
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
src/pulsecore/sink.c
src/pulsecore/source.c