mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -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
|
|
@ -528,11 +528,13 @@ impl_node_port_use_buffers(void *object,
|
|||
|
||||
port = GET_PORT(this, direction, port_id);
|
||||
|
||||
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