From 3d3d86fd2493f80979911956e026cbd9d651e42c Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 12 Nov 2018 09:53:49 +0100 Subject: [PATCH] node: set clock id and position --- src/pipewire/node.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/pipewire/node.c b/src/pipewire/node.c index 229a44342..57917eb95 100644 --- a/src/pipewire/node.c +++ b/src/pipewire/node.c @@ -446,6 +446,7 @@ int pw_node_register(struct pw_node *this, struct pw_global *parent, struct pw_properties *properties) { + struct impl *impl = SPA_CONTAINER_OF(this, struct impl, this); struct pw_core *core = this->core; const char *str; @@ -478,6 +479,7 @@ int pw_node_register(struct pw_node *this, return -ENOMEM; this->info.id = this->global->id; + impl->position.clock.id = this->info.id; pw_properties_setf(this->properties, "node.id", "%d", this->info.id); pw_node_initialized(this); @@ -512,6 +514,13 @@ do_move_nodes(struct spa_loop *loop, spa_graph_node_remove(&this->rt.root); spa_graph_node_add(&dst->driver_graph, &this->rt.root); + if (spa_node_set_io(this->node, + SPA_IO_Position, + &dst->position, sizeof(struct spa_io_position)) >= 0) { + pw_log_debug("node %p: set position %p", this, &dst->position); + this->rt.position = &dst->position; + } + if (&src->driver_graph == &dst->driver_graph) return 0;