diff --git a/spa/plugins/audiomixer/audiomixer.c b/spa/plugins/audiomixer/audiomixer.c index 5a3d33f82..5ff1d6f24 100644 --- a/spa/plugins/audiomixer/audiomixer.c +++ b/spa/plugins/audiomixer/audiomixer.c @@ -295,7 +295,7 @@ impl_node_remove_port(void *object, enum spa_direction direction, uint32_t port_ } spa_memzero(port, sizeof(struct port)); - if (port_id == this->last_port + 1) { + if (port_id + 1 == this->last_port) { int i; for (i = this->last_port - 1; i >= 0; i--) diff --git a/spa/plugins/audiomixer/mixer-dsp.c b/spa/plugins/audiomixer/mixer-dsp.c index 5a7364327..95f28da4b 100644 --- a/spa/plugins/audiomixer/mixer-dsp.c +++ b/spa/plugins/audiomixer/mixer-dsp.c @@ -292,7 +292,7 @@ impl_node_remove_port(void *object, enum spa_direction direction, uint32_t port_ } spa_memzero(port, sizeof(struct port)); - if (port_id == this->last_port - 1) { + if (port_id + 1 == this->last_port) { int i; for (i = this->last_port - 1; i >= 0; i--) diff --git a/spa/plugins/control/mixer.c b/spa/plugins/control/mixer.c index 518a475ab..c55e907ce 100644 --- a/spa/plugins/control/mixer.c +++ b/spa/plugins/control/mixer.c @@ -256,7 +256,7 @@ impl_node_remove_port(void *object, enum spa_direction direction, uint32_t port_ } spa_memzero(port, sizeof(struct port)); - if (port_id == this->last_port - 1) { + if (port_id + 1 == this->last_port) { int i; for (i = this->last_port - 1; i >= 0; i--)