module-combine-stream: flush data in paused state

When stream is paused, internal delay buffers were cleared, but some
data could stay in stream output queue. Without a flush, these data where
played in front of a new data.
Patch was inspired by 64d6ff4184 fixing the
same issue in a filter-chain module.

Signed-off-by: Martin Geier <martin.geier@streamunlimited.com>
This commit is contained in:
Martin Geier 2025-04-17 11:58:28 +02:00
parent ff3bc8818f
commit c2e539b780

View file

@ -1073,6 +1073,7 @@ static void combine_state_changed(void *d, enum pw_stream_state old,
enum pw_stream_state state, const char *error)
{
struct impl *impl = d;
struct stream *s;
switch (state) {
case PW_STREAM_STATE_ERROR:
case PW_STREAM_STATE_UNCONNECTED:
@ -1080,6 +1081,10 @@ static void combine_state_changed(void *d, enum pw_stream_state old,
break;
case PW_STREAM_STATE_PAUSED:
clear_delaybuf(impl);
spa_list_for_each(s, &impl->streams, link) {
pw_stream_flush(s->stream, false);
}
pw_stream_flush(impl->combine, false);
impl->combine_id = pw_stream_get_node_id(impl->combine);
pw_log_info("got combine id %d", impl->combine_id);
break;