Commit 327553ae authored by Philipp Zabel's avatar Philipp Zabel Committed by Mauro Carvalho Chehab

media: vb2: clear V4L2_BUF_FLAG_LAST when filling vb2_buffer

V4L2_BUF_FLAG_LAST is a signal from the driver to userspace for buffers
on the capture queue. When userspace queues back a capture buffer with
the flag set, we should clear it.

Otherwise, if userspace restarts streaming after EOS, without
reallocating the buffers, mem2mem devices will erroneously signal EOS
prematurely, as soon as the already flagged buffer is dequeued.
Signed-off-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 645838b5
......@@ -434,6 +434,8 @@ static int __fill_vb2_buffer(struct vb2_buffer *vb,
} else {
/* Zero any output buffer flags as this is a capture buffer */
vbuf->flags &= ~V4L2_BUFFER_OUT_FLAGS;
/* Zero last flag, this is a signal from driver to userspace */
vbuf->flags &= ~V4L2_BUF_FLAG_LAST;
}
return 0;
......
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