mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-04 13:29:59 -05:00
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:
parent
64ba239f65
commit
b4a36453da
21 changed files with 57 additions and 81 deletions
|
|
@ -471,7 +471,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;
|
||||
|
||||
if (state == PA_SOURCE_RUNNING) {
|
||||
|
|
@ -496,7 +496,7 @@ static int sink_set_state_in_main_thread_cb(pa_sink *s, pa_sink_state_t state, p
|
|||
pa_assert_se(u = s->userdata);
|
||||
|
||||
if (!PA_SINK_IS_LINKED(state) ||
|
||||
!PA_SINK_INPUT_IS_LINKED(pa_sink_input_get_state(u->sink_input)))
|
||||
!PA_SINK_INPUT_IS_LINKED(u->sink_input->state))
|
||||
return 0;
|
||||
|
||||
if (state == PA_SINK_RUNNING) {
|
||||
|
|
@ -598,7 +598,7 @@ static void source_set_volume_cb(pa_source *s) {
|
|||
pa_assert_se(u = s->userdata);
|
||||
|
||||
if (!PA_SOURCE_IS_LINKED(pa_source_get_state(s)) ||
|
||||
!PA_SOURCE_OUTPUT_IS_LINKED(pa_source_output_get_state(u->source_output)))
|
||||
!PA_SOURCE_OUTPUT_IS_LINKED(u->source_output->state))
|
||||
return;
|
||||
|
||||
pa_source_output_set_volume(u->source_output, &s->real_volume, s->save_volume, true);
|
||||
|
|
@ -612,7 +612,7 @@ static void sink_set_volume_cb(pa_sink *s) {
|
|||
pa_assert_se(u = s->userdata);
|
||||
|
||||
if (!PA_SINK_IS_LINKED(pa_sink_get_state(s)) ||
|
||||
!PA_SINK_INPUT_IS_LINKED(pa_sink_input_get_state(u->sink_input)))
|
||||
!PA_SINK_INPUT_IS_LINKED(u->sink_input->state))
|
||||
return;
|
||||
|
||||
pa_sink_input_set_volume(u->sink_input, &s->real_volume, s->save_volume, true);
|
||||
|
|
@ -627,7 +627,7 @@ static void source_get_volume_cb(pa_source *s) {
|
|||
pa_assert_se(u = s->userdata);
|
||||
|
||||
if (!PA_SOURCE_IS_LINKED(pa_source_get_state(s)) ||
|
||||
!PA_SOURCE_OUTPUT_IS_LINKED(pa_source_output_get_state(u->source_output)))
|
||||
!PA_SOURCE_OUTPUT_IS_LINKED(u->source_output->state))
|
||||
return;
|
||||
|
||||
pa_source_output_get_volume(u->source_output, &v, true);
|
||||
|
|
@ -648,7 +648,7 @@ static void source_set_mute_cb(pa_source *s) {
|
|||
pa_assert_se(u = s->userdata);
|
||||
|
||||
if (!PA_SOURCE_IS_LINKED(pa_source_get_state(s)) ||
|
||||
!PA_SOURCE_OUTPUT_IS_LINKED(pa_source_output_get_state(u->source_output)))
|
||||
!PA_SOURCE_OUTPUT_IS_LINKED(u->source_output->state))
|
||||
return;
|
||||
|
||||
pa_source_output_set_mute(u->source_output, s->muted, s->save_muted);
|
||||
|
|
@ -662,7 +662,7 @@ static void sink_set_mute_cb(pa_sink *s) {
|
|||
pa_assert_se(u = s->userdata);
|
||||
|
||||
if (!PA_SINK_IS_LINKED(pa_sink_get_state(s)) ||
|
||||
!PA_SINK_INPUT_IS_LINKED(pa_sink_input_get_state(u->sink_input)))
|
||||
!PA_SINK_INPUT_IS_LINKED(u->sink_input->state))
|
||||
return;
|
||||
|
||||
pa_sink_input_set_mute(u->sink_input, s->muted, s->save_muted);
|
||||
|
|
@ -902,7 +902,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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -671,7 +671,7 @@ static void route_sink_input(struct userdata *u, pa_sink_input *si) {
|
|||
/* It might happen that a stream and a sink are set up at the
|
||||
same time, in which case we want to make sure we don't
|
||||
interfere with that */
|
||||
if (!PA_SINK_INPUT_IS_LINKED(pa_sink_input_get_state(si)))
|
||||
if (!PA_SINK_INPUT_IS_LINKED(si->state))
|
||||
return;
|
||||
|
||||
if (!(role = pa_proplist_gets(si->proplist, PA_PROP_MEDIA_ROLE)))
|
||||
|
|
@ -746,7 +746,7 @@ static void route_source_output(struct userdata *u, pa_source_output *so) {
|
|||
/* It might happen that a stream and a source are set up at the
|
||||
same time, in which case we want to make sure we don't
|
||||
interfere with that */
|
||||
if (!PA_SOURCE_OUTPUT_IS_LINKED(pa_source_output_get_state(so)))
|
||||
if (!PA_SOURCE_OUTPUT_IS_LINKED(so->state))
|
||||
return;
|
||||
|
||||
if (!(role = pa_proplist_gets(so->proplist, PA_PROP_MEDIA_ROLE)))
|
||||
|
|
|
|||
|
|
@ -280,7 +280,7 @@ static int sink_set_state_in_main_thread_cb(pa_sink *s, pa_sink_state_t state, p
|
|||
pa_assert_se(u = s->userdata);
|
||||
|
||||
if (!PA_SINK_IS_LINKED(state) ||
|
||||
!PA_SINK_INPUT_IS_LINKED(pa_sink_input_get_state(u->sink_input)))
|
||||
!PA_SINK_INPUT_IS_LINKED(u->sink_input->state))
|
||||
return 0;
|
||||
|
||||
pa_sink_input_cork(u->sink_input, state == PA_SINK_SUSPENDED);
|
||||
|
|
@ -344,7 +344,7 @@ static void sink_set_volume_cb(pa_sink *s) {
|
|||
pa_assert_se(u = s->userdata);
|
||||
|
||||
if (!PA_SINK_IS_LINKED(pa_sink_get_state(s)) ||
|
||||
!PA_SINK_INPUT_IS_LINKED(pa_sink_input_get_state(u->sink_input)))
|
||||
!PA_SINK_INPUT_IS_LINKED(u->sink_input->state))
|
||||
return;
|
||||
|
||||
pa_sink_input_set_volume(u->sink_input, &s->real_volume, s->save_volume, true);
|
||||
|
|
@ -358,7 +358,7 @@ static void sink_set_mute_cb(pa_sink *s) {
|
|||
pa_assert_se(u = s->userdata);
|
||||
|
||||
if (!PA_SINK_IS_LINKED(pa_sink_get_state(s)) ||
|
||||
!PA_SINK_INPUT_IS_LINKED(pa_sink_input_get_state(u->sink_input)))
|
||||
!PA_SINK_INPUT_IS_LINKED(u->sink_input->state))
|
||||
return;
|
||||
|
||||
pa_sink_input_set_mute(u->sink_input, s->muted, s->save_muted);
|
||||
|
|
|
|||
|
|
@ -186,7 +186,7 @@ static pa_hook_result_t sink_put_hook_callback(pa_core *c, pa_sink *sink, struct
|
|||
/* It might happen that a stream and a sink are set up at the
|
||||
same time, in which case we want to make sure we don't
|
||||
interfere with that */
|
||||
if (!PA_SINK_INPUT_IS_LINKED(pa_sink_input_get_state(si)))
|
||||
if (!PA_SINK_INPUT_IS_LINKED(si->state))
|
||||
continue;
|
||||
|
||||
if (!(role = pa_proplist_gets(si->proplist, PA_PROP_MEDIA_ROLE)))
|
||||
|
|
@ -236,7 +236,7 @@ static pa_hook_result_t source_put_hook_callback(pa_core *c, pa_source *source,
|
|||
/* It might happen that a stream and a source are set up at the
|
||||
same time, in which case we want to make sure we don't
|
||||
interfere with that */
|
||||
if (!PA_SOURCE_OUTPUT_IS_LINKED(pa_source_output_get_state(so)))
|
||||
if (!PA_SOURCE_OUTPUT_IS_LINKED(so->state))
|
||||
continue;
|
||||
|
||||
if (!(role = pa_proplist_gets(so->proplist, PA_PROP_MEDIA_ROLE)))
|
||||
|
|
|
|||
|
|
@ -387,7 +387,7 @@ static int sink_set_state_in_main_thread_cb(pa_sink *s, pa_sink_state_t state, p
|
|||
pa_assert_se(u = s->userdata);
|
||||
|
||||
if (!PA_SINK_IS_LINKED(state) ||
|
||||
!PA_SINK_INPUT_IS_LINKED(pa_sink_input_get_state(u->sink_input)))
|
||||
!PA_SINK_INPUT_IS_LINKED(u->sink_input->state))
|
||||
return 0;
|
||||
|
||||
pa_sink_input_cork(u->sink_input, state == PA_SINK_SUSPENDED);
|
||||
|
|
@ -453,7 +453,7 @@ static void sink_set_mute_cb(pa_sink *s) {
|
|||
pa_assert_se(u = s->userdata);
|
||||
|
||||
if (!PA_SINK_IS_LINKED(pa_sink_get_state(s)) ||
|
||||
!PA_SINK_INPUT_IS_LINKED(pa_sink_input_get_state(u->sink_input)))
|
||||
!PA_SINK_INPUT_IS_LINKED(u->sink_input->state))
|
||||
return;
|
||||
|
||||
pa_sink_input_set_mute(u->sink_input, s->muted, s->save_muted);
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ static int sink_set_state_in_main_thread(pa_sink *s, pa_sink_state_t state, pa_s
|
|||
pa_assert_se(u = s->userdata);
|
||||
|
||||
if (!PA_SINK_IS_LINKED(state) ||
|
||||
!PA_SINK_INPUT_IS_LINKED(pa_sink_input_get_state(u->sink_input)))
|
||||
!PA_SINK_INPUT_IS_LINKED(u->sink_input->state))
|
||||
return 0;
|
||||
|
||||
pa_sink_input_cork(u->sink_input, state == PA_SINK_SUSPENDED);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1657,7 +1657,7 @@ static pa_hook_result_t sink_put_hook_callback(pa_core *c, pa_sink *sink, struct
|
|||
/* It might happen that a stream and a sink are set up at the
|
||||
same time, in which case we want to make sure we don't
|
||||
interfere with that */
|
||||
if (!PA_SINK_INPUT_IS_LINKED(pa_sink_input_get_state(si)))
|
||||
if (!PA_SINK_INPUT_IS_LINKED(si->state))
|
||||
continue;
|
||||
|
||||
if (!(name = pa_proplist_get_stream_group(si->proplist, "sink-input", IDENTIFICATION_PROPERTY)))
|
||||
|
|
@ -1710,7 +1710,7 @@ static pa_hook_result_t source_put_hook_callback(pa_core *c, pa_source *source,
|
|||
/* It might happen that a stream and a source are set up at the
|
||||
same time, in which case we want to make sure we don't
|
||||
interfere with that */
|
||||
if (!PA_SOURCE_OUTPUT_IS_LINKED(pa_source_output_get_state(so)))
|
||||
if (!PA_SOURCE_OUTPUT_IS_LINKED(so->state))
|
||||
continue;
|
||||
|
||||
if (!(name = pa_proplist_get_stream_group(so->proplist, "source-output", IDENTIFICATION_PROPERTY)))
|
||||
|
|
|
|||
|
|
@ -215,14 +215,12 @@ static pa_hook_result_t sink_input_move_start_hook_cb(pa_core *c, pa_sink_input
|
|||
|
||||
static pa_hook_result_t sink_input_move_finish_hook_cb(pa_core *c, pa_sink_input *s, struct userdata *u) {
|
||||
struct device_info *d;
|
||||
pa_sink_input_state_t state;
|
||||
|
||||
pa_assert(c);
|
||||
pa_sink_input_assert_ref(s);
|
||||
pa_assert(u);
|
||||
|
||||
state = pa_sink_input_get_state(s);
|
||||
if (state != PA_SINK_INPUT_RUNNING)
|
||||
if (s->state != PA_SINK_INPUT_RUNNING)
|
||||
return PA_HOOK_OK;
|
||||
|
||||
if ((d = pa_hashmap_get(u->device_infos, s->sink)))
|
||||
|
|
@ -259,7 +257,7 @@ static pa_hook_result_t source_output_move_finish_hook_cb(pa_core *c, pa_source_
|
|||
pa_source_output_assert_ref(s);
|
||||
pa_assert(u);
|
||||
|
||||
if (pa_source_output_get_state(s) != PA_SOURCE_OUTPUT_RUNNING)
|
||||
if (s->state != PA_SOURCE_OUTPUT_RUNNING)
|
||||
return PA_HOOK_OK;
|
||||
|
||||
if (s->source->monitor_of)
|
||||
|
|
@ -275,14 +273,12 @@ static pa_hook_result_t source_output_move_finish_hook_cb(pa_core *c, pa_source_
|
|||
|
||||
static pa_hook_result_t sink_input_state_changed_hook_cb(pa_core *c, pa_sink_input *s, struct userdata *u) {
|
||||
struct device_info *d;
|
||||
pa_sink_input_state_t state;
|
||||
|
||||
pa_assert(c);
|
||||
pa_sink_input_assert_ref(s);
|
||||
pa_assert(u);
|
||||
|
||||
state = pa_sink_input_get_state(s);
|
||||
if (state == PA_SINK_INPUT_RUNNING && s->sink)
|
||||
if (s->state == PA_SINK_INPUT_RUNNING && s->sink)
|
||||
if ((d = pa_hashmap_get(u->device_infos, s->sink)))
|
||||
resume(d);
|
||||
|
||||
|
|
@ -294,7 +290,7 @@ static pa_hook_result_t source_output_state_changed_hook_cb(pa_core *c, pa_sourc
|
|||
pa_source_output_assert_ref(s);
|
||||
pa_assert(u);
|
||||
|
||||
if (pa_source_output_get_state(s) == PA_SOURCE_OUTPUT_RUNNING && s->source) {
|
||||
if (s->state == PA_SOURCE_OUTPUT_RUNNING && s->source) {
|
||||
struct device_info *d;
|
||||
|
||||
if (s->source->monitor_of)
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ static int sink_set_state_in_main_thread_cb(pa_sink *s, pa_sink_state_t state, p
|
|||
pa_assert_se(u = s->userdata);
|
||||
|
||||
if (!PA_SINK_IS_LINKED(state) ||
|
||||
!PA_SINK_INPUT_IS_LINKED(pa_sink_input_get_state(u->sink_input)))
|
||||
!PA_SINK_INPUT_IS_LINKED(u->sink_input->state))
|
||||
return 0;
|
||||
|
||||
pa_sink_input_cork(u->sink_input, state == PA_SINK_SUSPENDED);
|
||||
|
|
@ -185,7 +185,7 @@ static void sink_set_volume_cb(pa_sink *s) {
|
|||
pa_assert_se(u = s->userdata);
|
||||
|
||||
if (!PA_SINK_IS_LINKED(pa_sink_get_state(s)) ||
|
||||
!PA_SINK_INPUT_IS_LINKED(pa_sink_input_get_state(u->sink_input)))
|
||||
!PA_SINK_INPUT_IS_LINKED(u->sink_input->state))
|
||||
return;
|
||||
|
||||
pa_sink_input_set_volume(u->sink_input, &s->real_volume, s->save_volume, true);
|
||||
|
|
@ -199,7 +199,7 @@ static void sink_set_mute_cb(pa_sink *s) {
|
|||
pa_assert_se(u = s->userdata);
|
||||
|
||||
if (!PA_SINK_IS_LINKED(pa_sink_get_state(s)) ||
|
||||
!PA_SINK_INPUT_IS_LINKED(pa_sink_input_get_state(u->sink_input)))
|
||||
!PA_SINK_INPUT_IS_LINKED(u->sink_input->state))
|
||||
return;
|
||||
|
||||
pa_sink_input_set_mute(u->sink_input, s->muted, s->save_muted);
|
||||
|
|
|
|||
|
|
@ -201,7 +201,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);
|
||||
|
|
@ -233,7 +233,7 @@ static void source_set_volume_cb(pa_source *s) {
|
|||
pa_assert_se(u = s->userdata);
|
||||
|
||||
if (!PA_SOURCE_IS_LINKED(pa_source_get_state(s)) ||
|
||||
!PA_SOURCE_OUTPUT_IS_LINKED(pa_source_output_get_state(u->source_output)))
|
||||
!PA_SOURCE_OUTPUT_IS_LINKED(u->source_output->state))
|
||||
return;
|
||||
|
||||
pa_source_output_set_volume(u->source_output, &s->real_volume, s->save_volume, true);
|
||||
|
|
@ -247,7 +247,7 @@ static void source_set_mute_cb(pa_source *s) {
|
|||
pa_assert_se(u = s->userdata);
|
||||
|
||||
if (!PA_SOURCE_IS_LINKED(pa_source_get_state(s)) ||
|
||||
!PA_SOURCE_OUTPUT_IS_LINKED(pa_source_output_get_state(u->source_output)))
|
||||
!PA_SOURCE_OUTPUT_IS_LINKED(u->source_output->state))
|
||||
return;
|
||||
|
||||
pa_source_output_set_mute(u->source_output, s->muted, s->save_muted);
|
||||
|
|
@ -264,7 +264,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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@ static int sink_set_state_in_main_thread_cb(pa_sink *s, pa_sink_state_t state, p
|
|||
pa_assert_se(u = s->userdata);
|
||||
|
||||
if (!PA_SINK_IS_LINKED(state) ||
|
||||
!PA_SINK_INPUT_IS_LINKED(pa_sink_input_get_state(u->sink_input)))
|
||||
!PA_SINK_INPUT_IS_LINKED(u->sink_input->state))
|
||||
return 0;
|
||||
|
||||
pa_sink_input_cork(u->sink_input, state == PA_SINK_SUSPENDED);
|
||||
|
|
@ -213,7 +213,7 @@ static void sink_set_volume_cb(pa_sink *s) {
|
|||
pa_assert_se(u = s->userdata);
|
||||
|
||||
if (!PA_SINK_IS_LINKED(pa_sink_get_state(s)) ||
|
||||
!PA_SINK_INPUT_IS_LINKED(pa_sink_input_get_state(u->sink_input)))
|
||||
!PA_SINK_INPUT_IS_LINKED(u->sink_input->state))
|
||||
return;
|
||||
|
||||
pa_sink_input_set_volume(u->sink_input, &s->real_volume, s->save_volume, true);
|
||||
|
|
@ -227,7 +227,7 @@ static void sink_set_mute_cb(pa_sink *s) {
|
|||
pa_assert_se(u = s->userdata);
|
||||
|
||||
if (!PA_SINK_IS_LINKED(pa_sink_get_state(s)) ||
|
||||
!PA_SINK_INPUT_IS_LINKED(pa_sink_input_get_state(u->sink_input)))
|
||||
!PA_SINK_INPUT_IS_LINKED(u->sink_input->state))
|
||||
return;
|
||||
|
||||
pa_sink_input_set_mute(u->sink_input, s->muted, s->save_muted);
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ static const char *find_trigger_stream(struct userdata *u, pa_sink *s, pa_sink_i
|
|||
continue;
|
||||
|
||||
trigger_role = get_trigger_role(u, j, g);
|
||||
if (trigger_role && !j->muted && pa_sink_input_get_state(j) != PA_SINK_INPUT_CORKED)
|
||||
if (trigger_role && !j->muted && j->state != PA_SINK_INPUT_CORKED)
|
||||
return trigger_role;
|
||||
}
|
||||
|
||||
|
|
@ -185,7 +185,7 @@ static inline void apply_interaction_to_sink(struct userdata *u, pa_sink *s, con
|
|||
/* the application only after sink_input_put() was called. If a new stream turns */
|
||||
/* up, act as if it was not corked. In the case of module-role-cork this will */
|
||||
/* only mute the stream because corking is reverted later by the application */
|
||||
corked = (pa_sink_input_get_state(j) == PA_SINK_INPUT_CORKED);
|
||||
corked = (j->state == PA_SINK_INPUT_CORKED);
|
||||
if (new_stream && corked)
|
||||
corked = false;
|
||||
interaction_applied = !!pa_hashmap_get(g->interaction_state, j);
|
||||
|
|
@ -227,7 +227,7 @@ static void remove_interactions(struct userdata *u, struct group *g) {
|
|||
for (j = PA_SINK_INPUT(pa_idxset_first(s->inputs, &idx_input)); j; j = PA_SINK_INPUT(pa_idxset_next(s->inputs, &idx_input))) {
|
||||
|
||||
if(!!pa_hashmap_get(g->interaction_state, j)) {
|
||||
corked = (pa_sink_input_get_state(j) == PA_SINK_INPUT_CORKED);
|
||||
corked = (j->state == PA_SINK_INPUT_CORKED);
|
||||
if (!(role = pa_proplist_gets(j->proplist, PA_PROP_MEDIA_ROLE)))
|
||||
role = "no_role";
|
||||
uncork_or_unduck(u, j, role, corked, g);
|
||||
|
|
@ -289,7 +289,7 @@ static pa_hook_result_t sink_input_state_changed_cb(pa_core *core, pa_sink_input
|
|||
pa_core_assert_ref(core);
|
||||
pa_sink_input_assert_ref(i);
|
||||
|
||||
if (PA_SINK_INPUT_IS_LINKED(pa_sink_input_get_state(i)) && get_trigger_role(u, i, NULL))
|
||||
if (PA_SINK_INPUT_IS_LINKED(i->state) && get_trigger_role(u, i, NULL))
|
||||
return process(u, i, true, false);
|
||||
|
||||
return PA_HOOK_OK;
|
||||
|
|
@ -299,7 +299,7 @@ static pa_hook_result_t sink_input_mute_changed_cb(pa_core *core, pa_sink_input
|
|||
pa_core_assert_ref(core);
|
||||
pa_sink_input_assert_ref(i);
|
||||
|
||||
if (PA_SINK_INPUT_IS_LINKED(pa_sink_input_get_state(i)) && get_trigger_role(u, i, NULL))
|
||||
if (PA_SINK_INPUT_IS_LINKED(i->state) && get_trigger_role(u, i, NULL))
|
||||
return process(u, i, true, false);
|
||||
|
||||
return PA_HOOK_OK;
|
||||
|
|
@ -309,7 +309,7 @@ static pa_hook_result_t sink_input_proplist_changed_cb(pa_core *core, pa_sink_in
|
|||
pa_core_assert_ref(core);
|
||||
pa_sink_input_assert_ref(i);
|
||||
|
||||
if (PA_SINK_INPUT_IS_LINKED(pa_sink_input_get_state(i)))
|
||||
if (PA_SINK_INPUT_IS_LINKED(i->state))
|
||||
return process(u, i, true, false);
|
||||
|
||||
return PA_HOOK_OK;
|
||||
|
|
|
|||
|
|
@ -489,7 +489,7 @@ char *pa_source_output_list_to_string(pa_core *c) {
|
|||
o->flags & PA_SOURCE_OUTPUT_NO_CREATE_ON_SUSPEND ? "NO_CREATE_ON_SUSPEND " : "",
|
||||
o->flags & PA_SOURCE_OUTPUT_KILL_ON_SUSPEND ? "KILL_ON_SUSPEND " : "",
|
||||
o->flags & PA_SOURCE_OUTPUT_PASSTHROUGH ? "PASSTHROUGH " : "",
|
||||
state_table[pa_source_output_get_state(o)],
|
||||
state_table[o->state],
|
||||
o->source->index, o->source->name,
|
||||
volume_str,
|
||||
pa_yes_no(o->muted),
|
||||
|
|
@ -586,7 +586,7 @@ char *pa_sink_input_list_to_string(pa_core *c) {
|
|||
i->flags & PA_SINK_INPUT_NO_CREATE_ON_SUSPEND ? "NO_CREATE_SUSPEND " : "",
|
||||
i->flags & PA_SINK_INPUT_KILL_ON_SUSPEND ? "KILL_ON_SUSPEND " : "",
|
||||
i->flags & PA_SINK_INPUT_PASSTHROUGH ? "PASSTHROUGH " : "",
|
||||
state_table[pa_sink_input_get_state(i)],
|
||||
state_table[i->state],
|
||||
i->sink->index, i->sink->name,
|
||||
volume_str,
|
||||
pa_yes_no(i->muted),
|
||||
|
|
|
|||
|
|
@ -2880,7 +2880,7 @@ static void command_get_playback_latency(pa_pdispatch *pd, uint32_t command, uin
|
|||
pa_tagstruct_put_boolean(reply,
|
||||
s->playing_for > 0 &&
|
||||
pa_sink_get_state(s->sink_input->sink) == PA_SINK_RUNNING &&
|
||||
pa_sink_input_get_state(s->sink_input) == PA_SINK_INPUT_RUNNING);
|
||||
s->sink_input->state == PA_SINK_INPUT_RUNNING);
|
||||
pa_tagstruct_put_timeval(reply, &tv);
|
||||
pa_tagstruct_put_timeval(reply, pa_gettimeofday(&now));
|
||||
pa_tagstruct_puts64(reply, s->write_index);
|
||||
|
|
@ -2925,7 +2925,7 @@ static void command_get_record_latency(pa_pdispatch *pd, uint32_t command, uint3
|
|||
pa_bytes_to_usec(s->on_the_fly_snapshot, &s->source_output->sample_spec));
|
||||
pa_tagstruct_put_boolean(reply,
|
||||
pa_source_get_state(s->source_output->source) == PA_SOURCE_RUNNING &&
|
||||
pa_source_output_get_state(s->source_output) == PA_SOURCE_OUTPUT_RUNNING);
|
||||
s->source_output->state == PA_SOURCE_OUTPUT_RUNNING);
|
||||
pa_tagstruct_put_timeval(reply, &tv);
|
||||
pa_tagstruct_put_timeval(reply, pa_gettimeofday(&now));
|
||||
pa_tagstruct_puts64(reply, pa_memblockq_get_write_index(s->memblockq));
|
||||
|
|
@ -3392,7 +3392,7 @@ static void sink_input_fill_tagstruct(pa_native_connection *c, pa_tagstruct *t,
|
|||
if (c->version >= 13)
|
||||
pa_tagstruct_put_proplist(t, s->proplist);
|
||||
if (c->version >= 19)
|
||||
pa_tagstruct_put_boolean(t, (pa_sink_input_get_state(s) == PA_SINK_INPUT_CORKED));
|
||||
pa_tagstruct_put_boolean(t, s->state == PA_SINK_INPUT_CORKED);
|
||||
if (c->version >= 20) {
|
||||
pa_tagstruct_put_boolean(t, has_volume);
|
||||
pa_tagstruct_put_boolean(t, s->volume_writable);
|
||||
|
|
@ -3432,7 +3432,7 @@ static void source_output_fill_tagstruct(pa_native_connection *c, pa_tagstruct *
|
|||
if (c->version >= 13)
|
||||
pa_tagstruct_put_proplist(t, s->proplist);
|
||||
if (c->version >= 19)
|
||||
pa_tagstruct_put_boolean(t, (pa_source_output_get_state(s) == PA_SOURCE_OUTPUT_CORKED));
|
||||
pa_tagstruct_put_boolean(t, s->state == PA_SOURCE_OUTPUT_CORKED);
|
||||
if (c->version >= 22) {
|
||||
pa_tagstruct_put_cvolume(t, &v);
|
||||
pa_tagstruct_put_boolean(t, s->muted);
|
||||
|
|
|
|||
|
|
@ -359,7 +359,7 @@ int pa_sink_input_new(
|
|||
|
||||
pa_return_val_if_fail(PA_SINK_IS_LINKED(pa_sink_get_state(data->sink)), -PA_ERR_BADSTATE);
|
||||
pa_return_val_if_fail(!data->sync_base || (data->sync_base->sink == data->sink
|
||||
&& pa_sink_input_get_state(data->sync_base) == PA_SINK_INPUT_CORKED),
|
||||
&& data->sync_base->state == PA_SINK_INPUT_CORKED),
|
||||
-PA_ERR_INVALID);
|
||||
|
||||
/* Routing is done. We have a sink and a format. */
|
||||
|
|
@ -1720,7 +1720,7 @@ int pa_sink_input_start_move(pa_sink_input *i) {
|
|||
|
||||
pa_idxset_remove_by_data(i->sink->inputs, i, NULL);
|
||||
|
||||
if (pa_sink_input_get_state(i) == PA_SINK_INPUT_CORKED)
|
||||
if (i->state == PA_SINK_INPUT_CORKED)
|
||||
pa_assert_se(i->sink->n_corked-- >= 1);
|
||||
|
||||
if (pa_sink_input_is_passthrough(i))
|
||||
|
|
@ -1922,7 +1922,7 @@ int pa_sink_input_finish_move(pa_sink_input *i, pa_sink *dest, bool save) {
|
|||
|
||||
pa_cvolume_remap(&i->volume_factor_sink, &i->channel_map, &i->sink->channel_map);
|
||||
|
||||
if (pa_sink_input_get_state(i) == PA_SINK_INPUT_CORKED)
|
||||
if (i->state == PA_SINK_INPUT_CORKED)
|
||||
i->sink->n_corked++;
|
||||
|
||||
pa_sink_input_update_rate(i);
|
||||
|
|
@ -2113,14 +2113,6 @@ int pa_sink_input_process_msg(pa_msgobject *o, int code, void *userdata, int64_t
|
|||
return -PA_ERR_NOTIMPLEMENTED;
|
||||
}
|
||||
|
||||
/* Called from main thread */
|
||||
pa_sink_input_state_t pa_sink_input_get_state(pa_sink_input *i) {
|
||||
pa_sink_input_assert_ref(i);
|
||||
pa_assert_ctl_context();
|
||||
|
||||
return i->state;
|
||||
}
|
||||
|
||||
/* Called from IO context */
|
||||
bool pa_sink_input_safe_to_remove(pa_sink_input *i) {
|
||||
pa_sink_input_assert_ref(i);
|
||||
|
|
|
|||
|
|
@ -394,8 +394,6 @@ int pa_sink_input_start_move(pa_sink_input *i);
|
|||
int pa_sink_input_finish_move(pa_sink_input *i, pa_sink *dest, bool save);
|
||||
void pa_sink_input_fail_move(pa_sink_input *i);
|
||||
|
||||
pa_sink_input_state_t pa_sink_input_get_state(pa_sink_input *i);
|
||||
|
||||
pa_usec_t pa_sink_input_get_requested_latency(pa_sink_input *i);
|
||||
|
||||
/* To be used exclusively by the sink driver IO thread */
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -1356,7 +1356,7 @@ int pa_source_output_start_move(pa_source_output *o) {
|
|||
|
||||
pa_idxset_remove_by_data(o->source->outputs, o, NULL);
|
||||
|
||||
if (pa_source_output_get_state(o) == PA_SOURCE_OUTPUT_CORKED)
|
||||
if (o->state == PA_SOURCE_OUTPUT_CORKED)
|
||||
pa_assert_se(origin->n_corked-- >= 1);
|
||||
|
||||
if (pa_source_output_is_passthrough(o))
|
||||
|
|
@ -1551,7 +1551,7 @@ int pa_source_output_finish_move(pa_source_output *o, pa_source *dest, bool save
|
|||
|
||||
pa_cvolume_remap(&o->volume_factor_source, &o->channel_map, &o->source->channel_map);
|
||||
|
||||
if (pa_source_output_get_state(o) == PA_SOURCE_OUTPUT_CORKED)
|
||||
if (o->state == PA_SOURCE_OUTPUT_CORKED)
|
||||
o->source->n_corked++;
|
||||
|
||||
pa_source_output_update_rate(o);
|
||||
|
|
|
|||
|
|
@ -344,8 +344,6 @@ int pa_source_output_start_move(pa_source_output *o);
|
|||
int pa_source_output_finish_move(pa_source_output *o, pa_source *dest, bool save);
|
||||
void pa_source_output_fail_move(pa_source_output *o);
|
||||
|
||||
#define pa_source_output_get_state(o) ((o)->state)
|
||||
|
||||
pa_usec_t pa_source_output_get_requested_latency(pa_source_output *o);
|
||||
|
||||
/* To be used exclusively by the source driver thread */
|
||||
|
|
|
|||
|
|
@ -2024,22 +2024,18 @@ unsigned pa_source_check_suspend(pa_source *s, pa_source_output *ignore) {
|
|||
ret = 0;
|
||||
|
||||
PA_IDXSET_FOREACH(o, s->outputs, idx) {
|
||||
pa_source_output_state_t st;
|
||||
|
||||
if (o == ignore)
|
||||
continue;
|
||||
|
||||
st = pa_source_output_get_state(o);
|
||||
|
||||
/* We do not assert here. It is perfectly valid for a source output 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_SOURCE_OUTPUT_IS_LINKED(st))
|
||||
if (!PA_SOURCE_OUTPUT_IS_LINKED(o->state))
|
||||
continue;
|
||||
|
||||
if (st == PA_SOURCE_OUTPUT_CORKED)
|
||||
if (o->state == PA_SOURCE_OUTPUT_CORKED)
|
||||
continue;
|
||||
|
||||
if (o->flags & PA_SOURCE_OUTPUT_DONT_INHIBIT_AUTO_SUSPEND)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue