]> Pileus Git - ~andy/linux/commitdiff
V4L/DVB (9031): uvcvideo: Fix incomplete frame drop when switching to a variable...
authorLaurent Pinchart <laurent.pinchart@skynet.be>
Tue, 16 Sep 2008 01:24:29 +0000 (22:24 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sun, 12 Oct 2008 11:37:08 +0000 (09:37 -0200)
When streaming in a fixed size format the driver sets a flag in the uvc_queue
structure to drop incomplete incoming frames. The flag wasn't cleared when
switching to a variable size format, which resulted in a broken
'MJPEG after YUV'.

Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/uvc/uvc_v4l2.c
drivers/media/video/uvc/uvc_video.c

index d4758c8e13ad48ea8825d26355cad70219b43b2c..78e4c4e09d89cb1c5fae161b7cce07f412712917 100644 (file)
@@ -842,10 +842,6 @@ static int uvc_v4l2_do_ioctl(struct inode *inode, struct file *file,
                if (ret < 0)
                        return ret;
 
-               if (!(video->streaming->cur_format->flags &
-                   UVC_FMT_FLAG_COMPRESSED))
-                       video->queue.flags |= UVC_QUEUE_DROP_INCOMPLETE;
-
                rb->count = ret;
                ret = 0;
                break;
index 593aebffe57dc6c34c403c88391e820f32482f75..b7bb23820d803013548ef99ce91ccd52039102fb 100644 (file)
@@ -971,6 +971,11 @@ int uvc_video_enable(struct uvc_video_device *video, int enable)
                return 0;
        }
 
+       if (video->streaming->cur_format->flags & UVC_FMT_FLAG_COMPRESSED)
+               video->queue.flags &= ~UVC_QUEUE_DROP_INCOMPLETE;
+       else
+               video->queue.flags |= UVC_QUEUE_DROP_INCOMPLETE;
+
        if ((ret = uvc_queue_enable(&video->queue, 1)) < 0)
                return ret;