sink-input, source-output: remove the state getters

pa_sink_input_get_state() and pa_source_output_get_state() just return
the state variable. We can as well access the state variable directly.

There are no behaviour changes, except that some filter sources accessed
the main thread's state variable from their push() callbacks. I fixed
them so that they use the thread_info.state variable instead.
This commit is contained in:
Tanu Kaskinen 2018-06-26 16:25:57 +03:00
parent 64ba239f65
commit b4a36453da
21 changed files with 57 additions and 81 deletions

View file

@ -2456,22 +2456,18 @@ unsigned pa_sink_check_suspend(pa_sink *s, pa_sink_input *ignore_input, pa_sourc
ret = 0;
PA_IDXSET_FOREACH(i, s->inputs, idx) {
pa_sink_input_state_t st;
if (i == ignore_input)
continue;
st = pa_sink_input_get_state(i);
/* We do not assert here. It is perfectly valid for a sink input to
* be in the INIT state (i.e. created, marked done but not yet put)
* and we should not care if it's unlinked as it won't contribute
* towards our busy status.
*/
if (!PA_SINK_INPUT_IS_LINKED(st))
if (!PA_SINK_INPUT_IS_LINKED(i->state))
continue;
if (st == PA_SINK_INPUT_CORKED)
if (i->state == PA_SINK_INPUT_CORKED)
continue;
if (i->flags & PA_SINK_INPUT_DONT_INHIBIT_AUTO_SUSPEND)