From 085f87d85f83659b86e4ab880e389fa934f03962 Mon Sep 17 00:00:00 2001 From: Elaine Xiong Date: Fri, 17 Jul 2009 13:22:57 +0100 Subject: v4l2: Fix v4l2src on OpenSolaris The v4l2 driver for USB webcams on OpenSolaris does not support select() calls. Detect when select() fails, and skip polling the device afterward, which restores the pre 0.10.14 behaviour on OpenSolaris. Signed-off-by: Jan Schmidt --- sys/v4l2/gstv4l2src.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'sys/v4l2/gstv4l2src.c') diff --git a/sys/v4l2/gstv4l2src.c b/sys/v4l2/gstv4l2src.c index 9ebe101f..329ced5a 100644 --- a/sys/v4l2/gstv4l2src.c +++ b/sys/v4l2/gstv4l2src.c @@ -1248,8 +1248,14 @@ gst_v4l2src_get_read (GstV4l2Src * v4l2src, GstBuffer ** buf) if (G_UNLIKELY (ret < 0)) { if (errno == EBUSY) goto stopped; - if (errno != EAGAIN && errno != EINTR) - goto select_error; + if (errno == ENXIO) { + GST_DEBUG_OBJECT (v4l2src, + "v4l2 device doesn't support polling. Disabling"); + v4l2src->v4l2object->can_poll_device = FALSE; + } else { + if (errno != EAGAIN && errno != EINTR) + goto select_error; + } } amount = v4l2_read (v4l2src->v4l2object->video_fd, GST_BUFFER_DATA (*buf), -- cgit