Commit b1855907 authored by Jaime Velasco Juan's avatar Jaime Velasco Juan Committed by Mauro Carvalho Chehab

V4L/DVB (8491): stkwebcam: Always reuse last queued buffer

This change keeps the video stream going on when the application
is slow queuing buffers, instead of spamming dmesg and hanging.

Fixes a problem with aMSN reported by Samed Beyribey <beyribey@gmail.com>
Signed-off-by: default avatarJaime Velasco Juan <jsagarribay@gmail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent f78d92c9
...@@ -445,18 +445,19 @@ static void stk_isoc_handler(struct urb *urb) ...@@ -445,18 +445,19 @@ static void stk_isoc_handler(struct urb *urb)
fb->v4lbuf.bytesused = 0; fb->v4lbuf.bytesused = 0;
fill = fb->buffer; fill = fb->buffer;
} else if (fb->v4lbuf.bytesused == dev->frame_size) { } else if (fb->v4lbuf.bytesused == dev->frame_size) {
list_move_tail(dev->sio_avail.next, if (list_is_singular(&dev->sio_avail)) {
&dev->sio_full); /* Always reuse the last buffer */
wake_up(&dev->wait_frame); fb->v4lbuf.bytesused = 0;
if (list_empty(&dev->sio_avail)) { fill = fb->buffer;
(void) (printk_ratelimit() && } else {
STK_ERROR("No buffer available\n")); list_move_tail(dev->sio_avail.next,
goto resubmit; &dev->sio_full);
wake_up(&dev->wait_frame);
fb = list_first_entry(&dev->sio_avail,
struct stk_sio_buffer, list);
fb->v4lbuf.bytesused = 0;
fill = fb->buffer;
} }
fb = list_first_entry(&dev->sio_avail,
struct stk_sio_buffer, list);
fb->v4lbuf.bytesused = 0;
fill = fb->buffer;
} }
} else { } else {
framelen -= 4; framelen -= 4;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment