mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
spa: handle last_port correctly
last_port is always 1 more than the highest valid port number.
This commit is contained in:
parent
d793086174
commit
19a3bf2100
3 changed files with 3 additions and 3 deletions
|
|
@ -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--)
|
||||
|
|
|
|||
|
|
@ -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--)
|
||||
|
|
|
|||
|
|
@ -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--)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue