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

@ -115,7 +115,7 @@ static int source_set_state_in_main_thread_cb(pa_source *s, pa_source_state_t st
pa_assert_se(u = s->userdata);
if (!PA_SOURCE_IS_LINKED(state) ||
!PA_SOURCE_OUTPUT_IS_LINKED(pa_source_output_get_state(u->source_output)))
!PA_SOURCE_OUTPUT_IS_LINKED(u->source_output->state))
return 0;
pa_source_output_cork(u->source_output, state == PA_SOURCE_SUSPENDED);
@ -152,7 +152,7 @@ static void source_output_push_cb(pa_source_output *o, const pa_memchunk *chunk)
if (!PA_SOURCE_IS_LINKED(u->source->thread_info.state))
return;
if (!PA_SOURCE_OUTPUT_IS_LINKED(pa_source_output_get_state(u->source_output))) {
if (!PA_SOURCE_OUTPUT_IS_LINKED(u->source_output->thread_info.state)) {
pa_log("push when no link?");
return;
}