Skip to contentSkip to conversation

pixfmt-test: fix VIDIOC_G_STD call for webcams

PATCH New Németh Márton 1 participant 1 message Nov 3, 2009 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pixfmt-test: fix VIDIOC_G_STD call for webcams

From: Márton Németh <[email protected]>

Webcams may return -1 and errno=EINVAL when there is no standard which they support. Handle this case in pixfmt-test.

---

v4l2-apps/test/pixfmt-test.c +3 -1
diff -r 43878f8dbfb0 v4l2-apps/test/pixfmt-test.c
@@ -1741,8 +1741,10 @@
 		/* Errors ignored. */
 	}
 
+	/* Webcams may not support any standard at all, see
+	   http://v4l2spec.bytesex.org/spec/x448.htm for details */
 	if (-1 == xioctl (dev_fd, VIDIOC_G_STD, &std_id))
-		errno_exit ("VIDIOC_G_STD");
+		std_id = 0;
 }
 
 static void