[media] coda: adjust sequence offset after unexpected decoded frame
authorLucas Stach <[email protected]>
Fri, 23 Jan 2015 16:51:19 +0000 (13:51 -0300)
committerMauro Carvalho Chehab <[email protected]>
Mon, 2 Feb 2015 12:00:10 +0000 (10:00 -0200)
If userspace doesn't properly separate the bitstream input into
individual frames (which may happen for example on slightly
corrupted streams) the CODA hardware may decode more frames
than we expect. We already log an error in this case, but it's
also necessary to adjust the sequence offset. Otherwise we
spam the log with a sequence number mismatch on every frame
frame after the unexpected one.

Signed-off-by: Lucas Stach <[email protected]>
Signed-off-by: Kamil Debski <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
drivers/media/platform/coda/coda-bit.c

index f6cf337bf377f1aabea4f5896efd4140ec79c971..6b00a45e84a41bd308d77ffabf506e0f9a615b2d 100644 (file)
@@ -1822,6 +1822,7 @@ static void coda_finish_decode(struct coda_ctx *ctx)
                        memset(&ctx->frame_metas[decoded_idx], 0,
                               sizeof(struct coda_buffer_meta));
                        ctx->frame_metas[decoded_idx].sequence = val;
+                       ctx->sequence_offset++;
                }
                mutex_unlock(&ctx->bitstream_mutex);