diff options
author | Suren A. Chilingaryan <csa@suren.me> | 2015-04-28 22:40:51 +0200 |
---|---|---|
committer | Suren A. Chilingaryan <csa@suren.me> | 2015-04-28 22:40:51 +0200 |
commit | 4130584c764aecb55ccb259ad8e9816a6fd423b9 (patch) | |
tree | f6c93debdbb7c8552da56fef67558598fddc436f /reader.c | |
parent | b44c763039a5ca01efd6d5ef19fb941e2996554e (diff) | |
download | ipecamera-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.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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); |