mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-01 22:58:50 -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
|
|
@ -756,14 +756,15 @@ static int impl_node_port_use_buffers(void *object,
|
|||
|
||||
port = GET_PORT(this, direction, port_id);
|
||||
|
||||
if (!port->have_format)
|
||||
return -EIO;
|
||||
|
||||
if (port->n_buffers) {
|
||||
spa_v4l2_stream_off(this);
|
||||
if ((res = spa_v4l2_clear_buffers(this)) < 0)
|
||||
return res;
|
||||
}
|
||||
if (n_buffers > 0 && !port->have_format)
|
||||
return -EIO;
|
||||
if (n_buffers > MAX_BUFFERS)
|
||||
return -ENOSPC;
|
||||
if (buffers == NULL)
|
||||
return 0;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue