This is an automatic generated email to let you know that the following patch 
were queued at the 
http://git.linuxtv.org/media_tree.git tree:

Subject: [media] uvcvideo: Fix marking buffer erroneous in case of FID toggling
Author:  Anton Leontiev <[email protected]>
Date:    Tue Mar 25 01:40:57 2014 -0300

Set error bit for incomplete buffers when end of buffer is detected by
FID toggling (for example when last transaction with EOF is lost).
This prevents passing incomplete buffers to the userspace.

Signed-off-by: Anton Leontiev <[email protected]>
Signed-off-by: Laurent Pinchart <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>

 drivers/media/usb/uvc/uvc_video.c |   21 +++++++++++++++------
 1 files changed, 15 insertions(+), 6 deletions(-)

---

http://git.linuxtv.org/media_tree.git?a=commitdiff;h=f8918ba071bbd7e3b9a3f6400d4bcfd893bc5dc9

diff --git a/drivers/media/usb/uvc/uvc_video.c 
b/drivers/media/usb/uvc/uvc_video.c
index 8d52baf..ca205ee 100644
--- a/drivers/media/usb/uvc/uvc_video.c
+++ b/drivers/media/usb/uvc/uvc_video.c
@@ -1133,6 +1133,17 @@ static int uvc_video_encode_data(struct uvc_streaming 
*stream,
  */
 
 /*
+ * Set error flag for incomplete buffer.
+ */
+static void uvc_video_validate_buffer(const struct uvc_streaming *stream,
+                                     struct uvc_buffer *buf)
+{
+       if (buf->length != buf->bytesused &&
+           !(stream->cur_format->flags & UVC_FMT_FLAG_COMPRESSED))
+               buf->error = 1;
+}
+
+/*
  * Completion handler for video URBs.
  */
 static void uvc_video_decode_isoc(struct urb *urb, struct uvc_streaming 
*stream,
@@ -1156,9 +1167,11 @@ static void uvc_video_decode_isoc(struct urb *urb, 
struct uvc_streaming *stream,
                do {
                        ret = uvc_video_decode_start(stream, buf, mem,
                                urb->iso_frame_desc[i].actual_length);
-                       if (ret == -EAGAIN)
+                       if (ret == -EAGAIN) {
+                               uvc_video_validate_buffer(stream, buf);
                                buf = uvc_queue_next_buffer(&stream->queue,
                                                            buf);
+                       }
                } while (ret == -EAGAIN);
 
                if (ret < 0)
@@ -1173,11 +1186,7 @@ static void uvc_video_decode_isoc(struct urb *urb, 
struct uvc_streaming *stream,
                        urb->iso_frame_desc[i].actual_length);
 
                if (buf->state == UVC_BUF_STATE_READY) {
-                       if (buf->length != buf->bytesused &&
-                           !(stream->cur_format->flags &
-                             UVC_FMT_FLAG_COMPRESSED))
-                               buf->error = 1;
-
+                       uvc_video_validate_buffer(stream, buf);
                        buf = uvc_queue_next_buffer(&stream->queue, buf);
                }
        }

_______________________________________________
linuxtv-commits mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to