summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2008-07-22 15:28:36 +0000
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-07-22 15:28:36 +0000
commit864de2be6bbbffb01707d727382eda327967d167 (patch)
treee495fa3b2b9d529c968abb0f8c8afc5e9cb45836
parent6c80285db2bbd7b7261fc1c10941787223acb3f4 (diff)
downloadmediapointer-dvb-s2-864de2be6bbbffb01707d727382eda327967d167.tar.gz
mediapointer-dvb-s2-864de2be6bbbffb01707d727382eda327967d167.tar.bz2
stkwebcam: Always reuse last queued buffer
From: Jaime Velasco Juan <jsagarribay@gmail.com> 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: Jaime Velasco Juan <jsagarribay@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
-rw-r--r--linux/drivers/media/video/stk-webcam.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/linux/drivers/media/video/stk-webcam.c b/linux/drivers/media/video/stk-webcam.c
index 5daa2294d..c5f766653 100644
--- a/linux/drivers/media/video/stk-webcam.c
+++ b/linux/drivers/media/video/stk-webcam.c
@@ -446,18 +446,19 @@ static void stk_isoc_handler(struct urb *urb)
fb->v4lbuf.bytesused = 0;
fill = fb->buffer;
} else if (fb->v4lbuf.bytesused == dev->frame_size) {
- list_move_tail(dev->sio_avail.next,
- &dev->sio_full);
- wake_up(&dev->wait_frame);
- if (list_empty(&dev->sio_avail)) {
- (void) (printk_ratelimit() &&
- STK_ERROR("No buffer available\n"));
- goto resubmit;
+ if (list_is_singular(&dev->sio_avail)) {
+ /* Always reuse the last buffer */
+ fb->v4lbuf.bytesused = 0;
+ fill = fb->buffer;
+ } else {
+ list_move_tail(dev->sio_avail.next,
+ &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 {
framelen -= 4;