client-node: only clear ports once

This commit is contained in:
Wim Taymans 2018-08-14 16:53:05 +02:00
parent 954da89756
commit d4ab36d52a

View file

@ -557,14 +557,18 @@ clear_port(struct node *this, struct port *port)
}
if (port->direction == SPA_DIRECTION_INPUT) {
if (this->in_ports[port->id] == port) {
this->in_ports[port->id] = NULL;
this->n_inputs--;
}
}
else {
if (this->out_ports[port->id] == port) {
this->out_ports[port->id] = NULL;
this->n_outputs--;
}
}
}
static int
impl_node_add_port(struct spa_node *node, enum spa_direction direction, uint32_t port_id)