mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-05 13:30:02 -05:00
node: set clock id and position
This commit is contained in:
parent
e03289b4ac
commit
3d3d86fd24
1 changed files with 9 additions and 0 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue