sink-input: remove the DRAINED state

The only thing that the drained state was being used for was "pacmd
list-sink-inputs". In all other cases the drained and running states
were treated as equivalent. IMHO, this usage doesn't justify the
complexity that the additional state brings.

This patch was inspired by a bug report[1] that pointed out an error in
an if condition in pa_sink_input_set_state_within_thread(). The buggy
code is now removed altogether.

[1] https://bugs.freedesktop.org/show_bug.cgi?id=106982
This commit is contained in:
Tanu Kaskinen 2018-06-26 16:25:56 +03:00
parent e40adfa9cc
commit 64ba239f65
4 changed files with 3 additions and 23 deletions

View file

@ -222,7 +222,7 @@ static pa_hook_result_t sink_input_move_finish_hook_cb(pa_core *c, pa_sink_input
pa_assert(u);
state = pa_sink_input_get_state(s);
if (state != PA_SINK_INPUT_RUNNING && state != PA_SINK_INPUT_DRAINED)
if (state != PA_SINK_INPUT_RUNNING)
return PA_HOOK_OK;
if ((d = pa_hashmap_get(u->device_infos, s->sink)))
@ -282,7 +282,7 @@ static pa_hook_result_t sink_input_state_changed_hook_cb(pa_core *c, pa_sink_inp
pa_assert(u);
state = pa_sink_input_get_state(s);
if ((state == PA_SINK_INPUT_RUNNING || state == PA_SINK_INPUT_DRAINED) && s->sink)
if (state == PA_SINK_INPUT_RUNNING && s->sink)
if ((d = pa_hashmap_get(u->device_infos, s->sink)))
resume(d);