Commit 0f8f6338 authored by Philipp Zabel's avatar Philipp Zabel Committed by Mauro Carvalho Chehab
Browse files

media: coda: only wake up capture queue if no pending buffers to encode



If there are no pending queued output buffers to be encoded, waking up
the capture queue with -EPIPE signals end of stream. If there are
pending buffers on the other hand, setting the V4L2_BUF_FLAG_LAST on
the resulting encoded capture buffers is all that is needed.

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 0ee08a1e
Loading
Loading
Loading
Loading
+9 −8
Original line number Diff line number Diff line
@@ -1035,9 +1035,9 @@ static int coda_encoder_cmd(struct file *file, void *fh,
		return ret;

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

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

@@ -1046,6 +1046,7 @@ static int coda_encoder_cmd(struct file *file, void *fh,
		/* If there is no buffer in flight, wake up */
		if (!ctx->streamon_out || ctx->qsequence == ctx->osequence)
			coda_wake_up_capture_queue(ctx);
	}

	return 0;
}