impl-node: don't pass the -EBUSY to the caller

Let the caller receive EBUSY from the _set_state method instead of
an error code to make sure it doesn't go into error.
This commit is contained in:
Wim Taymans 2022-12-08 12:38:36 +01:00
parent 9bf6fa05d1
commit dee2a51eb0

View file

@ -2257,11 +2257,10 @@ int pw_impl_node_set_state(struct pw_impl_node *node, enum pw_node_state state)
/* driver nodes return EBUSY to add a -EBUSY to the work queue. This
* will wait until all previous items in the work queue are
* completed */
if (res == EBUSY)
res = -res;
impl->pending_state = state;
impl->pending_id = pw_work_queue_add(impl->work,
node, res, on_state_complete, SPA_INT_TO_PTR(state));
node, res == EBUSY ? -EBUSY : res,
on_state_complete, SPA_INT_TO_PTR(state));
}
return res;
}