From 4130584c764aecb55ccb259ad8e9816a6fd423b9 Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Tue, 28 Apr 2015 22:40:51 +0200 Subject: Support CMOSIS bug resulting in missing payload --- reader.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'reader.c') diff --git a/reader.c b/reader.c index db700cd..63806f1 100644 --- a/reader.c +++ b/reader.c @@ -38,6 +38,11 @@ int ipecamera_compute_buffer_size(ipecamera_t *ctx, size_t lines) { raw_size = lines * line_size; raw_size *= 16 / ctx->cmosis_outputs; raw_size += header_size + footer_size; + +#ifdef IPECAMERA_BUG_MISSING_PAYLOAD + // As I understand, the first 32-byte packet is missing, so we need to substract 32 + raw_size -= 32; +#endif /* IPECAMERA_BUG_MISSING_PAYLOAD */ } padded_blocks = raw_size / IPECAMERA_DMA_PACKET_LENGTH + ((raw_size % IPECAMERA_DMA_PACKET_LENGTH)?1:0); -- cgit v1.2.3