fix use_buffers checks

We can set 0 buffers even if there is no format.
Return -ENOSPC when too many buffers are set.
This commit is contained in:
Wim Taymans 2023-01-10 12:30:25 +01:00
parent 9f3237b74e
commit 97aafe2234
31 changed files with 146 additions and 88 deletions

View file

@ -2219,7 +2219,7 @@ static int client_node_port_use_buffers(void *data,
if (n_buffers > MAX_BUFFERS) {
pw_log_error("%p: too many buffers %u > %u", c, n_buffers, MAX_BUFFERS);
return -EINVAL;
return -ENOSPC;
}
if (p->object->port.type_id == TYPE_ID_VIDEO && direction == SPA_DIRECTION_INPUT) {