v4l2: handle ENOTTY

Instead of erroring out, go to the next format when enumerating frame
size or frame interval.

See #3325
This commit is contained in:
Wim Taymans 2023-07-04 11:36:37 +02:00
parent 4137ff656a
commit 42a099381b

View file

@ -627,7 +627,7 @@ spa_v4l2_enum_format(struct impl *this, int seq,
} }
do_frmsize: do_frmsize:
if ((res = xioctl(dev->fd, VIDIOC_ENUM_FRAMESIZES, &port->frmsize)) < 0) { if ((res = xioctl(dev->fd, VIDIOC_ENUM_FRAMESIZES, &port->frmsize)) < 0) {
if (errno == EINVAL) if (errno == EINVAL || errno == ENOTTY)
goto next_fmtdesc; goto next_fmtdesc;
res = -errno; res = -errno;
@ -745,7 +745,7 @@ spa_v4l2_enum_format(struct impl *this, int seq,
while (true) { while (true) {
if ((res = xioctl(dev->fd, VIDIOC_ENUM_FRAMEINTERVALS, &port->frmival)) < 0) { if ((res = xioctl(dev->fd, VIDIOC_ENUM_FRAMEINTERVALS, &port->frmival)) < 0) {
res = -errno; res = -errno;
if (errno == EINVAL) { if (errno == EINVAL || errno == ENOTTY) {
port->frmsize.index++; port->frmsize.index++;
port->next_frmsize = true; port->next_frmsize = true;
if (port->frmival.index == 0) if (port->frmival.index == 0)