mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-16 08:56:45 -05:00
v4l2: use 32 buffers max
We don't yet probe the number of available buffers and so we might claim to support 64 buffers but then fail to allocate that many buffers in _use_buffers().
This commit is contained in:
parent
5b3336ce3e
commit
c44d655516
3 changed files with 9 additions and 3 deletions
|
|
@ -110,7 +110,7 @@ int spa_v4l2_close(struct spa_v4l2_device *dev)
|
|||
if (dev->fd == -1)
|
||||
return 0;
|
||||
|
||||
if (dev->active)
|
||||
if (dev->active || dev->have_format)
|
||||
return 0;
|
||||
|
||||
spa_log_info(dev->log, "v4l2: close");
|
||||
|
|
@ -916,6 +916,7 @@ static int spa_v4l2_set_format(struct impl *this, struct spa_video_info *format,
|
|||
if (try_only)
|
||||
return 0;
|
||||
|
||||
dev->have_format = true;
|
||||
size->width = fmt.fmt.pix.width;
|
||||
size->height = fmt.fmt.pix.height;
|
||||
port->rate.denom = framerate->num = streamparm.parm.capture.timeperframe.denominator;
|
||||
|
|
@ -1474,6 +1475,9 @@ static int spa_v4l2_stream_on(struct impl *this)
|
|||
if (dev->fd == -1)
|
||||
return -EIO;
|
||||
|
||||
if (!dev->have_format)
|
||||
return -EIO;
|
||||
|
||||
if (dev->active)
|
||||
return 0;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue