summaryrefslogtreecommitdiffstats
path: root/reader.c
diff options
context:
space:
mode:
Diffstat (limited to 'reader.c')
-rw-r--r--reader.c5
1 files changed, 5 insertions, 0 deletions
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);