From 61a570149322baef6d3e9de1e7d3fa5eaaa0493a Mon Sep 17 00:00:00 2001 From: Frank Krick Date: Mon, 11 Aug 2025 08:05:44 -0400 Subject: [PATCH] Add stream for control - 2 --- src/modules/module-filter-chain.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/modules/module-filter-chain.c b/src/modules/module-filter-chain.c index 8381e18a1..70224caec 100644 --- a/src/modules/module-filter-chain.c +++ b/src/modules/module-filter-chain.c @@ -1243,7 +1243,7 @@ static void control_process(void *d) static void playback_process(void *d) { struct impl *impl = d; - struct pw_buffer *in, *out; + struct pw_buffer *in, *out, *control; uint32_t i, data_size = 0; int32_t stride = 0; struct spa_data *bd; @@ -1262,6 +1262,18 @@ static void playback_process(void *d) if (in == NULL) pw_log_debug("%p: out of capture buffers: %m", impl); + control = NULL; + while (true) { + struct pw_buffer *t; + if ((t = pw_stream_dequeue_buffer(impl->control)) == NULL) + break; + if (control) + pw_stream_queue_buffer(impl->control, control); + control = t; + } + if (control == NULL) + pw_log_debug("%p: out of control buffers: %m", impl); + if ((out = pw_stream_dequeue_buffer(impl->playback)) == NULL) pw_log_debug("%p: out of playback buffers: %m", impl); @@ -1309,6 +1321,8 @@ done: pw_stream_queue_buffer(impl->capture, in); if (out != NULL) pw_stream_queue_buffer(impl->playback, out); + if (control != NULL) + pw_stream_queue_buffer(impl->control, control); } static int activate_graph(struct impl *impl)