mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-31 22:25:38 -04: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
|
|
@ -597,11 +597,13 @@ impl_node_port_use_buffers(void *object,
|
|||
spa_return_val_if_fail(CHECK_PORT(this, direction, port_id), -EINVAL);
|
||||
port = &this->port;
|
||||
|
||||
if (!port->have_format)
|
||||
return -EIO;
|
||||
|
||||
clear_buffers(this, port);
|
||||
|
||||
if (n_buffers > 0 && !port->have_format)
|
||||
return -EIO;
|
||||
if (n_buffers > MAX_BUFFERS)
|
||||
return -ENOSPC;
|
||||
|
||||
for (i = 0; i < n_buffers; i++) {
|
||||
struct buffer *b;
|
||||
struct spa_data *d = buffers[i]->datas;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue