Commit 9e3b94cc authored by Philipp Zabel's avatar Philipp Zabel Committed by Mauro Carvalho Chehab
Browse files

media: coda: mark the last output buffer on encoder stop command



Mark the last output buffer to be encoded.

Signed-off-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent a02f6ca3
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1037,12 +1037,17 @@ static int coda_encoder_cmd(struct file *file, void *fh,
			    struct v4l2_encoder_cmd *ec)
{
	struct coda_ctx *ctx = fh_to_ctx(fh);
	struct vb2_v4l2_buffer *buf;
	int ret;

	ret = coda_try_encoder_cmd(file, fh, ec);
	if (ret < 0)
		return ret;

	buf = v4l2_m2m_last_src_buf(ctx->fh.m2m_ctx);
	if (buf)
		buf->flags |= V4L2_BUF_FLAG_LAST;

	/* Set the stream-end flag on this context */
	ctx->bit_stream_param |= CODA_BIT_STREAM_END_FLAG;