mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 01:00:37 +00:00
v4l2: Handle v4l2_ioctl() errors even in error handling
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=721268
This commit is contained in:
parent
2bc631bcd0
commit
3f8b423516
1 changed files with 13 additions and 5 deletions
|
@ -2242,6 +2242,7 @@ gst_v4l2_object_get_nearest_size (GstV4l2Object * v4l2object,
|
|||
int fd;
|
||||
int r;
|
||||
int prevfmt_valid;
|
||||
gboolean ret = FALSE;
|
||||
|
||||
g_return_val_if_fail (width != NULL, FALSE);
|
||||
g_return_val_if_fail (height != NULL, FALSE);
|
||||
|
@ -2330,14 +2331,21 @@ gst_v4l2_object_get_nearest_size (GstV4l2Object * v4l2object,
|
|||
goto error;
|
||||
}
|
||||
|
||||
if (prevfmt_valid)
|
||||
v4l2_ioctl (fd, VIDIOC_S_FMT, &prevfmt);
|
||||
return TRUE;
|
||||
ret = TRUE;
|
||||
|
||||
error:
|
||||
if (!ret) {
|
||||
GST_WARNING_OBJECT (v4l2object->element,
|
||||
"Unable to try format: %s", g_strerror (errno));
|
||||
}
|
||||
if (prevfmt_valid)
|
||||
v4l2_ioctl (fd, VIDIOC_S_FMT, &prevfmt);
|
||||
return FALSE;
|
||||
if (v4l2_ioctl (fd, VIDIOC_S_FMT, &prevfmt) < 0) {
|
||||
GST_WARNING_OBJECT (v4l2object->element,
|
||||
"Unable to restore format after trying format: %s",
|
||||
g_strerror (errno));
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
|
Loading…
Reference in a new issue