mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-10 13:30:05 -05:00
impl-node: keep some state consistent
The target.id might be needed to find existing targets. Update the properties after setting the initial state for the node, it is a driver for itself and the properties can make it a driving node when the driver property is set.
This commit is contained in:
parent
c223e02d9b
commit
7007ffcae1
1 changed files with 5 additions and 2 deletions
|
|
@ -815,6 +815,7 @@ int pw_impl_node_register(struct pw_impl_node *this,
|
||||||
this->registered = true;
|
this->registered = true;
|
||||||
|
|
||||||
this->info.id = this->global->id;
|
this->info.id = this->global->id;
|
||||||
|
this->rt.target.id = this->info.id;
|
||||||
this->rt.target.activation->position.clock.id = this->global->id;
|
this->rt.target.activation->position.clock.id = this->global->id;
|
||||||
|
|
||||||
pw_properties_setf(this->properties, PW_KEY_OBJECT_ID, "%d", this->global->id);
|
pw_properties_setf(this->properties, PW_KEY_OBJECT_ID, "%d", this->global->id);
|
||||||
|
|
@ -1001,6 +1002,8 @@ static void check_properties(struct pw_impl_node *node)
|
||||||
else
|
else
|
||||||
remove_driver(context, node);
|
remove_driver(context, node);
|
||||||
}
|
}
|
||||||
|
if (driver && node->driver_node == node)
|
||||||
|
node->driving = true;
|
||||||
recalc_reason = "driver changed";
|
recalc_reason = "driver changed";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1518,11 +1521,11 @@ struct pw_impl_node *pw_context_create_node(struct pw_context *context,
|
||||||
this->rt.rate_limit.interval = 2 * SPA_NSEC_PER_SEC;
|
this->rt.rate_limit.interval = 2 * SPA_NSEC_PER_SEC;
|
||||||
this->rt.rate_limit.burst = 1;
|
this->rt.rate_limit.burst = 1;
|
||||||
|
|
||||||
check_properties(this);
|
|
||||||
|
|
||||||
this->driver_node = this;
|
this->driver_node = this;
|
||||||
spa_list_append(&this->follower_list, &this->follower_link);
|
spa_list_append(&this->follower_list, &this->follower_link);
|
||||||
|
|
||||||
|
check_properties(this);
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
|
|
||||||
error_clean:
|
error_clean:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue