audioadapter: remap port id for port_reuse_buffer on target

port_use_buffers and related port methods increment port_id when the
implicit output direction differs from the adapter's primary direction.
port_reuse_buffer only receives a port id but applies to output ports,
so apply the same offset before forwarding to this->target.

Also update videoadapter for the same mapping.
This commit is contained in:
zuozhiwei 2026-04-20 11:05:54 +08:00 committed by Wim Taymans
parent c3d16a39f5
commit 2722d16303
2 changed files with 6 additions and 0 deletions

View file

@ -1812,6 +1812,9 @@ impl_node_port_reuse_buffer(void *object, uint32_t port_id, uint32_t buffer_id)
spa_return_val_if_fail(this != NULL, -EINVAL); spa_return_val_if_fail(this != NULL, -EINVAL);
if (SPA_DIRECTION_OUTPUT != this->direction)
port_id++;
return spa_node_port_reuse_buffer(this->target, port_id, buffer_id); return spa_node_port_reuse_buffer(this->target, port_id, buffer_id);
} }

View file

@ -1779,6 +1779,9 @@ impl_node_port_reuse_buffer(void *object, uint32_t port_id, uint32_t buffer_id)
spa_return_val_if_fail(this != NULL, -EINVAL); spa_return_val_if_fail(this != NULL, -EINVAL);
if (SPA_DIRECTION_OUTPUT != this->direction)
port_id++;
return spa_node_port_reuse_buffer(this->target, port_id, buffer_id); return spa_node_port_reuse_buffer(this->target, port_id, buffer_id);
} }