summaryrefslogtreecommitdiffstats
path: root/reader.c
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2015-04-28 22:40:51 +0200
committerSuren A. Chilingaryan <csa@suren.me>2015-04-28 22:40:51 +0200
commit4130584c764aecb55ccb259ad8e9816a6fd423b9 (patch)
treef6c93debdbb7c8552da56fef67558598fddc436f /reader.c
parentb44c763039a5ca01efd6d5ef19fb941e2996554e (diff)
downloadipecamera-4130584c764aecb55ccb259ad8e9816a6fd423b9.tar.gz
ipecamera-4130584c764aecb55ccb259ad8e9816a6fd423b9.tar.bz2
ipecamera-4130584c764aecb55ccb259ad8e9816a6fd423b9.tar.xz
ipecamera-4130584c764aecb55ccb259ad8e9816a6fd423b9.zip
Support CMOSIS bug resulting in missing payload
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);