[media] coda: fix frame index to returned error
authorMichael Tretter <m.tretter@pengutronix.de>
Fri, 20 Jan 2017 14:00:23 +0000 (12:00 -0200)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Tue, 31 Jan 2017 10:16:03 +0000 (08:16 -0200)
display_idx refers to the frame that will be returned in the next round.
The currently processed frame is ctx->display_idx and errors should be
reported for this frame.

Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/platform/coda/coda-bit.c

index b6625047250d62c40ca153606aa0227ee4f4de86..309eb4eb5ad1d784b6d78ebb4069273bfd04ebe2 100644 (file)
@@ -2057,7 +2057,7 @@ static void coda_finish_decode(struct coda_ctx *ctx)
                }
                vb2_set_plane_payload(&dst_buf->vb2_buf, 0, payload);
 
-               coda_m2m_buf_done(ctx, dst_buf, ctx->frame_errors[display_idx] ?
+               coda_m2m_buf_done(ctx, dst_buf, ctx->frame_errors[ctx->display_idx] ?
                                  VB2_BUF_STATE_ERROR : VB2_BUF_STATE_DONE);
 
                v4l2_dbg(1, coda_debug, &dev->v4l2_dev,