From 94cde3090ebddf98cf21698ebbeeefe2d02fde1f Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 16 Jan 2024 16:41:15 +0100 Subject: [PATCH] stream: delay emit param changes when inside emit_param_changed When we are notifying the application of changed params, don't emit any changes applied to the params from within the callback with pw_stream_update_params(). This will be done after we complete the callback. This also avoids reseting the change counter so that we don't accidentally think we updated the formats param when we simply changed some other params. --- src/pipewire/stream.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/pipewire/stream.c b/src/pipewire/stream.c index 904a7c1dd..4165bdac4 100644 --- a/src/pipewire/stream.c +++ b/src/pipewire/stream.c @@ -2214,9 +2214,10 @@ int pw_stream_update_params(struct pw_stream *stream, if ((res = update_params(impl, SPA_ID_INVALID, params, n_params)) < 0) return res; - emit_node_info(impl, false); - emit_port_info(impl, false); - + if (impl->in_emit_param_changed == 0) { + emit_node_info(impl, false); + emit_port_info(impl, false); + } return res; }