Skip to content

Commit d63beb9

Browse files
Laurent PinchartMauro Carvalho Chehab
authored andcommitted
V4L/DVB (9031): uvcvideo: Fix incomplete frame drop when switching to a variable size format.
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 <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent 80845e1 commit d63beb9

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

drivers/media/video/uvc/uvc_v4l2.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -842,10 +842,6 @@ static int uvc_v4l2_do_ioctl(struct inode *inode, struct file *file,
842842
if (ret < 0)
843843
return ret;
844844

845-
if (!(video->streaming->cur_format->flags &
846-
UVC_FMT_FLAG_COMPRESSED))
847-
video->queue.flags |= UVC_QUEUE_DROP_INCOMPLETE;
848-
849845
rb->count = ret;
850846
ret = 0;
851847
break;

drivers/media/video/uvc/uvc_video.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -971,6 +971,11 @@ int uvc_video_enable(struct uvc_video_device *video, int enable)
971971
return 0;
972972
}
973973

974+
if (video->streaming->cur_format->flags & UVC_FMT_FLAG_COMPRESSED)
975+
video->queue.flags &= ~UVC_QUEUE_DROP_INCOMPLETE;
976+
else
977+
video->queue.flags |= UVC_QUEUE_DROP_INCOMPLETE;
978+
974979
if ((ret = uvc_queue_enable(&video->queue, 1)) < 0)
975980
return ret;
976981

0 commit comments

Comments
 (0)