Skip to content

Commit 76eb24f

Browse files
hverkuilmchehab
authored andcommitted
media: vicodec: reset last_src/dst_buf based on the IS_OUTPUT
When start_streaming was called both last_src_buf and last_dst_buf pointers were set to NULL, but this depends on whether the capture or output queue starts streaming. When decoding with resolution changes in between the capture queue has to restart streaming whenever a resolution change occurs. And that would reset last_src_buf as well, which causes a problem if the decoder was stopped by the application. Since last_src_buf is now NULL, the LAST flag is never set for the last capture buffer. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
1 parent f221b84 commit 76eb24f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

drivers/media/platform/vicodec/vicodec-core.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1337,8 +1337,11 @@ static int vicodec_start_streaming(struct vb2_queue *q,
13371337
chroma_div = info->width_div * info->height_div;
13381338
q_data->sequence = 0;
13391339

1340-
ctx->last_src_buf = NULL;
1341-
ctx->last_dst_buf = NULL;
1340+
if (V4L2_TYPE_IS_OUTPUT(q->type))
1341+
ctx->last_src_buf = NULL;
1342+
else
1343+
ctx->last_dst_buf = NULL;
1344+
13421345
state->gop_cnt = 0;
13431346

13441347
if ((V4L2_TYPE_IS_OUTPUT(q->type) && !ctx->is_enc) ||

0 commit comments

Comments
 (0)