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
This commit is contained in:
Ryan Lortie 2014-01-25 02:06:00 -05:00 committed by Sebastian Dröge
parent 8054cd5df3
commit a46f667853

View file

@ -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'."),