From a46f667853fecd34ffbbcfd0920295af930a80b7 Mon Sep 17 00:00:00 2001 From: Ryan Lortie Date: Sat, 25 Jan 2014 02:06:00 -0500 Subject: [PATCH] v4l2: guard use of ENODATA with #ifdef Not all systems with v4l have ENODATA defined, so check that we have it before attempting to use it. https://bugzilla.gnome.org/show_bug.cgi?id=722953 --- sys/v4l2/v4l2_calls.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/v4l2/v4l2_calls.c b/sys/v4l2/v4l2_calls.c index 7b2a4e4610..986df76af0 100644 --- a/sys/v4l2/v4l2_calls.c +++ b/sys/v4l2/v4l2_calls.c @@ -205,8 +205,12 @@ gst_v4l2_fill_lists (GstV4l2Object * v4l2object) standard.index = n; if (v4l2_ioctl (v4l2object->video_fd, VIDIOC_ENUMSTD, &standard) < 0) { - if (errno == EINVAL || errno == ENOTTY || errno == ENODATA) + if (errno == EINVAL || errno == ENOTTY) break; /* end of enumeration */ +#ifdef ENODATA + else if (errno == ENODATA) + break; /* end of enumeration, as of Linux 3.7-rc1 */ +#endif else { GST_ELEMENT_ERROR (e, RESOURCE, SETTINGS, (_("Failed to query norm on device '%s'."),