Add stream for control - 2

This commit is contained in:
Frank Krick 2025-08-11 08:05:44 -04:00
parent 9dc20765e1
commit 61a5701493

View file

@ -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)