stream: clear the draining/drained state when inactive

When we inactivate the stream, clear the draining/drained state.
Otherwise, the stream stays in the drained state and won't call the
process function anymore when we activate it again.

This used to work before because we called the process function from the
Start command, which would queue a buffer and unset the drained flag.
Calling the process function from Start was however not right when the
process function needed to be called from the RT thread or when the
stream is a driver.

Fixes the issue where speaker-test would only play one channel.
This commit is contained in:
Wim Taymans 2021-08-27 16:57:55 +02:00
parent 994630cb3a
commit 4677cc348c

View file

@ -1969,6 +1969,9 @@ int pw_stream_set_active(struct pw_stream *stream, bool active)
pw_log_debug(NAME" %p: active:%d", stream, active);
if (impl->node)
pw_impl_node_set_active(impl->node, active);
if (!active)
impl->drained = impl->draining = false;
return 0;
}