OSDN Git Service

media: uvcvideo: Mark buffer error where overflow
authorBaoyou Xie <baoyou.xie@linaro.org>
Thu, 7 Sep 2017 02:59:48 +0000 (22:59 -0400)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Fri, 8 Dec 2017 16:32:29 +0000 (11:32 -0500)
Some cameras post inaccurate frame where next frame data overlap
it. this results in screen flicker, and it need to be prevented.

So this patch marks the buffer error to discard the frame where
buffer overflow.

Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/usb/uvc/uvc_video.c

index f4ace63..73cd44e 100644 (file)
@@ -1077,6 +1077,7 @@ static void uvc_video_decode_data(struct uvc_streaming *stream,
        /* Complete the current frame if the buffer size was exceeded. */
        if (len > maxlen) {
                uvc_trace(UVC_TRACE_FRAME, "Frame complete (overflow).\n");
+               buf->error = 1;
                buf->state = UVC_BUF_STATE_READY;
        }
 }