summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/v4l1-compat.c
diff options
context:
space:
mode:
Diffstat (limited to 'linux/drivers/media/video/v4l1-compat.c')
-rw-r--r--linux/drivers/media/video/v4l1-compat.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/linux/drivers/media/video/v4l1-compat.c b/linux/drivers/media/video/v4l1-compat.c
index ba27685b7..6398d023d 100644
--- a/linux/drivers/media/video/v4l1-compat.c
+++ b/linux/drivers/media/video/v4l1-compat.c
@@ -301,6 +301,7 @@ v4l_compat_translate_ioctl(struct inode *inode,
{
struct v4l2_capability *cap2 = NULL;
struct v4l2_format *fmt2 = NULL;
+ enum v4l2_buf_type captype = V4L2_BUF_TYPE_VIDEO_CAPTURE;
struct v4l2_framebuffer fbuf2;
struct v4l2_input input2;
@@ -516,11 +517,10 @@ v4l_compat_translate_ioctl(struct inode *inode,
int *on = arg;
if (0 == *on) {
- enum v4l2_buf_type type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
/* dirty hack time. But v4l1 has no STREAMOFF
* equivalent in the API, and this one at
* least comes close ... */
- drv(inode, file, VIDIOC_STREAMOFF, &type);
+ drv(inode, file, VIDIOC_STREAMOFF, &captype);
}
err = drv(inode, file, VIDIOC_OVERLAY, arg);
if (err < 0)
@@ -871,7 +871,6 @@ v4l_compat_translate_ioctl(struct inode *inode,
case VIDIOCMCAPTURE: /* capture a frame */
{
struct video_mmap *mm = arg;
- enum v4l2_buf_type type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
fmt2 = kmalloc(sizeof(*fmt2),GFP_KERNEL);
memset(&buf2,0,sizeof(buf2));
@@ -912,7 +911,7 @@ v4l_compat_translate_ioctl(struct inode *inode,
dprintk("VIDIOCMCAPTURE / VIDIOC_QBUF: %d\n",err);
break;
}
- err = drv(inode, file, VIDIOC_STREAMON, &type);
+ err = drv(inode, file, VIDIOC_STREAMON, &captype);
if (err < 0)
dprintk("VIDIOCMCAPTURE / VIDIOC_STREAMON: %d\n",err);
break;
@@ -935,6 +934,13 @@ v4l_compat_translate_ioctl(struct inode *inode,
break;
}
+ /* make sure capture actually runs so we don't block forever */
+ err = drv(inode, file, VIDIOC_STREAMON, &captype);
+ if (err < 0) {
+ dprintk("VIDIOCSYNC / VIDIOC_STREAMON: %d\n",err);
+ break;
+ }
+
/* Loop as long as the buffer is queued, but not done */
while ((buf2.flags &
(V4L2_BUF_FLAG_QUEUED | V4L2_BUF_FLAG_DONE))