Commit 6aed423a authored by Philipp Zabel's avatar Philipp Zabel Committed by Greg Kroah-Hartman

coda: fix first encoded frame payload

commit 74dc385c upstream.

During the recent vb2_buffer restructuring, the calculation of the
buffer payload reported to userspace was accidentally broken for the
first encoded frame, counting only the length of the headers.
This patch re-adds the length of the actual frame data.

Fixes: 2d700715 ("[media] media: videobuf2: Restructure vb2_buffer")
Reported-by: default avatarMichael Olbrich <m.olbrich@pengutronix.de>
Signed-off-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
Tested-by: default avatarJan Luebbe <jlu@pengutronix.de>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 3c26bcd8
...@@ -1342,7 +1342,7 @@ static void coda_finish_encode(struct coda_ctx *ctx) ...@@ -1342,7 +1342,7 @@ static void coda_finish_encode(struct coda_ctx *ctx)
/* Calculate bytesused field */ /* Calculate bytesused field */
if (dst_buf->sequence == 0) { if (dst_buf->sequence == 0) {
vb2_set_plane_payload(&dst_buf->vb2_buf, 0, vb2_set_plane_payload(&dst_buf->vb2_buf, 0, wr_ptr - start_ptr +
ctx->vpu_header_size[0] + ctx->vpu_header_size[0] +
ctx->vpu_header_size[1] + ctx->vpu_header_size[1] +
ctx->vpu_header_size[2]); ctx->vpu_header_size[2]);
......
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