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: Jaime Velasco Juan <jsagarribay@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
This commit is contained in:
parent
f78d92c9ff
commit
b18559076a
|
@ -445,19 +445,20 @@ 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) {
|
||||||
|
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,
|
list_move_tail(dev->sio_avail.next,
|
||||||
&dev->sio_full);
|
&dev->sio_full);
|
||||||
wake_up(&dev->wait_frame);
|
wake_up(&dev->wait_frame);
|
||||||
if (list_empty(&dev->sio_avail)) {
|
|
||||||
(void) (printk_ratelimit() &&
|
|
||||||
STK_ERROR("No buffer available\n"));
|
|
||||||
goto resubmit;
|
|
||||||
}
|
|
||||||
fb = list_first_entry(&dev->sio_avail,
|
fb = list_first_entry(&dev->sio_avail,
|
||||||
struct stk_sio_buffer, list);
|
struct stk_sio_buffer, list);
|
||||||
fb->v4lbuf.bytesused = 0;
|
fb->v4lbuf.bytesused = 0;
|
||||||
fill = fb->buffer;
|
fill = fb->buffer;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
framelen -= 4;
|
framelen -= 4;
|
||||||
iso_buf += 4;
|
iso_buf += 4;
|
||||||
|
|
Reference in New Issue