From e757868cf90ffa6a026ebf5426e4bd3d0e134a41 Mon Sep 17 00:00:00 2001 From: lunks Date: Sun, 28 Apr 2024 07:51:02 +0000 Subject: [PATCH] combine-stream tag forward --- src/modules/module-combine-stream.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/modules/module-combine-stream.c b/src/modules/module-combine-stream.c index 84170105d..53249db2b 100644 --- a/src/modules/module-combine-stream.c +++ b/src/modules/module-combine-stream.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -618,6 +619,27 @@ static int do_add_stream(struct spa_loop *loop, bool async, uint32_t seq, return 0; } +static void param_tag_changed(struct impl *impl, const struct spa_pod *param) +{ + if (param == NULL) + return; + + pw_log_debug("tag update"); + struct stream *s; + struct spa_tag_info tag; + const struct spa_pod *params[1] = { param }; + void *state = NULL; + + if (spa_tag_parse(param, &tag, &state) < 0) + return; + spa_list_for_each(s, &impl->streams, link) { + if (s->stream == NULL) + continue; + pw_log_debug("updating stream %d", s->id); + pw_stream_update_params(s->stream, params, 1); + } +} + static int do_remove_stream(struct spa_loop *loop, bool async, uint32_t seq, const void *data, size_t size, void *user_data) { @@ -1247,6 +1269,10 @@ static void combine_param_changed(void *d, uint32_t id, const struct spa_pod *pa update_latency(impl); break; } + case SPA_PARAM_Tag: { + param_tag_changed(impl, param); + break; + } default: break; }