[vlc-commits] v4l2: work around drivers without VIDIOC_G_PARM (refs #7250)

Rémi Denis-Courmont git at videolan.org
Mon Jul 30 16:34:39 CEST 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Jul 30 17:32:34 2012 +0300| [7d24eb5161fc4aa7322d55ec0b73af0f498cc58d] | committer: Rémi Denis-Courmont

v4l2: work around drivers without VIDIOC_G_PARM (refs #7250)

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7d24eb5161fc4aa7322d55ec0b73af0f498cc58d
---

 modules/access/v4l2/video.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/modules/access/v4l2/video.c b/modules/access/v4l2/video.c
index 6ea3a92..dd2f3ce 100644
--- a/modules/access/v4l2/video.c
+++ b/modules/access/v4l2/video.c
@@ -500,7 +500,8 @@ int SetupFormat (vlc_object_t *obj, int fd, uint32_t fourcc,
     if (v4l2_ioctl (fd, VIDIOC_G_PARM, parm) < 0)
     {
         msg_Err (obj, "cannot get streaming parameters: %m");
-        return -1;
+        memset (parm, 0, sizeof (parm));
+        parm->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
     }
     parm->parm.capture.capturemode = 0; /* normal video mode */
     parm->parm.capture.extendedmode = 0;



More information about the vlc-commits mailing list