pulseaudio-12.0/src/pulsecore/sink-input.c:2017]: (style) Redundant condition: If 'EXPR == 1', the comparison 'EXPR != 2' is always true. Source code is if ((state == PA_SINK_INPUT_DRAINED || state == PA_SINK_INPUT_RUNNING) && !(i->thread_info.state == PA_SINK_INPUT_DRAINED || i->thread_info.state != PA_SINK_INPUT_RUNNING))
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.
I submitted a patch: https://patchwork.freedesktop.org/patch/232141/
The fix is in master now.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.