alsa: fix inverted port validity check in port_reuse_buffer

The CHECK_PORT condition in impl_node_port_reuse_buffer was inverted with a negation operator, causing the function to reject valid output ports and accept invalid ones.

Fixes the logic so that valid ports proceed to buffer recycling and invalid ports are properly rejected.
This commit is contained in:
zuozhiwei 2026-04-15 17:09:51 +08:00 committed by zhiwei zuo
parent ae723a69f6
commit 3277f3acfb

View file

@ -857,7 +857,7 @@ static int impl_node_port_reuse_buffer(void *object, uint32_t port_id, uint32_t
spa_return_val_if_fail(this != NULL, -EINVAL);
spa_return_val_if_fail(!CHECK_PORT(this, SPA_DIRECTION_OUTPUT, port_id), -EINVAL);
spa_return_val_if_fail(CHECK_PORT(this, SPA_DIRECTION_OUTPUT, port_id), -EINVAL);
port = GET_PORT(this, SPA_DIRECTION_OUTPUT, port_id);