From 4e070c90aa9675066330feab87cf66bcbd542e35 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 9 Jun 2023 17:06:48 +0200 Subject: [PATCH] module-profiler: ignore peer targets Only log the targets of the node, ignoring the peers of the driver or else we will log some nodes twice. Fixes #3278 --- src/modules/module-profiler.c | 2 +- src/pipewire/impl-link.c | 1 + src/pipewire/private.h | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/modules/module-profiler.c b/src/modules/module-profiler.c index 8b6360874..6aa0ee69c 100644 --- a/src/modules/module-profiler.c +++ b/src/modules/module-profiler.c @@ -221,7 +221,7 @@ static void context_do_profile(void *data, struct pw_impl_node *node) struct pw_node_activation *na; struct spa_fraction latency; - if (t->id == id) + if (t->id == id || t->flags & PW_NODE_TARGET_PEER) continue; if (n != NULL) { diff --git a/src/pipewire/impl-link.c b/src/pipewire/impl-link.c index d2eabd8df..090816b12 100644 --- a/src/pipewire/impl-link.c +++ b/src/pipewire/impl-link.c @@ -71,6 +71,7 @@ static struct pw_node_peer *pw_node_peer_ref(struct pw_impl_node *onode, struct peer->output = onode; peer->active_count = 0; copy_target(&peer->target, &inode->rt.target); + peer->target.flags = PW_NODE_TARGET_PEER; spa_list_append(&onode->peer_list, &peer->link); pw_log_debug("new peer %p from %p to %p", peer, onode, inode); diff --git a/src/pipewire/private.h b/src/pipewire/private.h index 0743a3d8b..f5621c10c 100644 --- a/src/pipewire/private.h +++ b/src/pipewire/private.h @@ -591,6 +591,9 @@ static inline void pw_node_activation_state_reset(struct pw_node_activation_stat struct pw_node_target { struct spa_list link; +#define PW_NODE_TARGET_NONE 0 +#define PW_NODE_TARGET_PEER 1 + uint32_t flags; uint32_t id; char name[128]; struct pw_impl_node *node;