node: check if active when ready event is emited

Add a check that the node is actually started when we get the ready
callback.
This commit is contained in:
Wim Taymans 2022-10-24 12:33:56 +02:00
parent 3d3851e5a3
commit 2c4e1b8537
2 changed files with 12 additions and 2 deletions

View file

@ -1155,6 +1155,11 @@ static int follower_ready(void *data, int status)
spa_log_trace_fp(this->log, "%p: ready %d", this, status);
if (!this->started) {
spa_log_warn(this->log, "%p: ready stopped node", this);
return -EIO;
}
if (this->target != this->follower) {
this->driver = true;

View file

@ -1624,8 +1624,13 @@ static int node_ready(void *data, int status)
struct pw_node_target *t;
struct pw_impl_port *p;
pw_log_trace_fp("%p: ready driver:%d exported:%d %p status:%d", node,
node->driver, node->exported, driver, status);
pw_log_trace_fp("%p: ready driver:%d exported:%d %p status:%d added:%d", node,
node->driver, node->exported, driver, status, node->added);
if (!node->added) {
pw_log_warn("%p: ready non-active node", node);
return -EIO;
}
if (SPA_UNLIKELY(node == driver)) {
struct pw_node_activation *a = node->rt.activation;