From 449a146784d554ef40e5dea3483cb5e9bacbb2c8 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Sat, 18 Jun 2016 02:20:29 +0300 Subject: Fix handling of last buffers before end of capture yavta is supposed not to requeue the last buffers before end of capture (unless requested to do so with the --requeue-last option). However, the logic is wrong, and only one of the last buffers is not requeued. Fix it by skipping all of the last buffers. Signed-off-by: Laurent Pinchart --- yavta.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yavta.c b/yavta.c index 06247e6..95821a5 100644 --- a/yavta.c +++ b/yavta.c @@ -1698,7 +1698,7 @@ static int video_do_capture(struct device *dev, unsigned int nframes, fflush(stdout); - if (i == nframes - dev->nbufs && !do_requeue_last) + if (i >= nframes - dev->nbufs && !do_requeue_last) continue; ret = video_queue_buffer(dev, buf.index, fill); -- cgit v1.2.3