https://bugs.freedesktop.org/show_bug.cgi?id=106982
--- Comment #1 from Tanu Kaskinen <ta...@iki.fi> ---
This is ancient code, and I'm not sure what Lennart intended to do. I found
out, though, that neither state nor i->thread_info.state can ever be DRAINED,
so the code could be simplified to
if (state == PA_SINK_INPUT_RUNNING && !(i->thread_info.state !=
PA_SINK_INPUT_RUNNING))
and that can be simplified to
if (state == PA_SINK_INPUT_RUNNING && i->thread_info.state ==
PA_SINK_INPUT_RUNNING)
That condition is never true, because there's an earlier check:
if (state == i->thread_info.state)
return;
I think the intent was to use == rather than != in the last comparison, so if
the state changes from non-running to running, then the sink input is marked as
drained.
In any case, the only purpose of the DRAINED state seems to be to show when the
sink input playback buffer is empty in the command line interface. In all other
contexts the DRAINED and RUNNING states are handled identically. I think the
usage doesn't justify the complexity, so I'll make a patch that removes the
DRAINED state altogether.
--
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.
_______________________________________________
pulseaudio-bugs mailing list
pulseaudio-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-bugs