mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-22 01:31:03 +00:00
v4l2codecs: Test ioctl return value and errno
Fix error testing when using V4L2_FMTDESC_FLAG_ENUM_ALL by using both errno and the return value. Fixes !7686 (merged) Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7873>
This commit is contained in:
parent
2bbf095e5b
commit
da02191411
1 changed files with 1 additions and 1 deletions
|
@ -539,7 +539,7 @@ gst_v4l2_decoder_enum_src_formats_full (GstV4l2Decoder * self,
|
|||
ret = ioctl (self->video_fd, VIDIOC_ENUM_FMT, &fmtdesc);
|
||||
/* If the driver can't enumerate all the pixels formats
|
||||
* return empty caps */
|
||||
if (enum_all && ret == -EINVAL) {
|
||||
if (enum_all && ret < 0 && errno == EINVAL) {
|
||||
gst_caps_unref (caps);
|
||||
return gst_static_caps_get (&default_src_caps);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue