impl-link: don't clear ouput buffers in all cases

When we can't set the allocated buffers on the input port, don't
clear the buffers because they might be in use by the output port.

Fixes #1078
This commit is contained in:
Wim Taymans 2021-04-21 11:43:07 +02:00
parent 01f2c91b89
commit bf5d40434d

View file

@ -461,7 +461,7 @@ static int do_allocation(struct pw_impl_link *this)
output->buffers.n_buffers)) < 0) {
error = spa_aprintf("error use output buffers: %d (%s)", res,
spa_strerror(res));
goto error;
goto error_clear;
}
if (SPA_RESULT_IS_ASYNC(res)) {
res = spa_node_sync(output->node->node, res),
@ -494,8 +494,9 @@ static int do_allocation(struct pw_impl_link *this)
}
return 0;
error:
error_clear:
pw_buffers_clear(&output->buffers);
error:
link_update_state(this, PW_LINK_STATE_ERROR, res, error);
return res;
}