|
|
@@ -1728,6 +1728,7 @@ static int __coda_start_decoding(struct coda_ctx *ctx)
|
|
|
v4l2_err(&dev->v4l2_dev, "CODA_COMMAND_SEQ_INIT timeout\n");
|
|
|
return ret;
|
|
|
}
|
|
|
+ ctx->sequence_offset = ~0U;
|
|
|
ctx->initialized = 1;
|
|
|
|
|
|
/* Update kfifo out pointer from coda bitstream read pointer */
|
|
|
@@ -2147,7 +2148,9 @@ static void coda_finish_decode(struct coda_ctx *ctx)
|
|
|
v4l2_err(&dev->v4l2_dev,
|
|
|
"decoded frame index out of range: %d\n", decoded_idx);
|
|
|
} else {
|
|
|
- val = coda_read(dev, CODA_RET_DEC_PIC_FRAME_NUM) - 1;
|
|
|
+ val = coda_read(dev, CODA_RET_DEC_PIC_FRAME_NUM);
|
|
|
+ if (ctx->sequence_offset == -1)
|
|
|
+ ctx->sequence_offset = val;
|
|
|
val -= ctx->sequence_offset;
|
|
|
spin_lock_irqsave(&ctx->buffer_meta_lock, flags);
|
|
|
if (!list_empty(&ctx->buffer_meta_list)) {
|