mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-07 13:30:09 -05:00
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:
parent
9f3237b74e
commit
97aafe2234
31 changed files with 146 additions and 88 deletions
|
|
@ -2049,13 +2049,16 @@ impl_node_port_use_buffers(void *object,
|
|||
|
||||
port = GET_PORT(this, direction, port_id);
|
||||
|
||||
spa_return_val_if_fail(port->have_format, -EIO);
|
||||
|
||||
spa_log_debug(this->log, "%p: use buffers %d on port %d:%d",
|
||||
this, n_buffers, direction, port_id);
|
||||
|
||||
clear_buffers(this, port);
|
||||
|
||||
if (n_buffers > 0 && !port->have_format)
|
||||
return -EIO;
|
||||
if (n_buffers > MAX_BUFFERS)
|
||||
return -ENOSPC;
|
||||
|
||||
maxsize = this->quantum_limit * sizeof(float);
|
||||
|
||||
for (i = 0; i < n_buffers; i++) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue