When capturing n image with p buffers, dequeued buffers don't need to be requeued in the last p iterations. Currently requeue in iteration n - p + 1 is skipped only. So skip requeue on all last p iterations. Also handle correctly the case when n < p. Signed-off-by: Todor Tomov <ttomov@xxxxxxxxxx> --- yavta.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yavta.c b/yavta.c index 49361ad..12f1608 100644 --- a/yavta.c +++ b/yavta.c @@ -1696,7 +1696,7 @@ static int video_do_capture(struct device *dev, unsigned int nframes, fflush(stdout); - if (i == nframes - dev->nbufs && !do_requeue_last) + if (i + dev->nbufs >= nframes && !do_requeue_last) continue; ret = video_queue_buffer(dev, buf.index, fill); -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html