summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2015-05-26 15:19:56 +0200
committerSuren A. Chilingaryan <csa@suren.me>2015-05-26 15:19:56 +0200
commita0d542a0daa195fa9780dd734ed13fd2d5bbd383 (patch)
tree35b2473a3270fc39138cb4fd6a457d24a1760445
parent56687fc6c32b06c6e726bf776e21d62753bf3442 (diff)
downloadipecamera-a0d542a0daa195fa9780dd734ed13fd2d5bbd383.tar.gz
ipecamera-a0d542a0daa195fa9780dd734ed13fd2d5bbd383.tar.bz2
ipecamera-a0d542a0daa195fa9780dd734ed13fd2d5bbd383.tar.xz
ipecamera-a0d542a0daa195fa9780dd734ed13fd2d5bbd383.zip
Adjust size of frame number
-rw-r--r--reader.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/reader.c b/reader.c
index 15a6289..ba568d4 100644
--- a/reader.c
+++ b/reader.c
@@ -134,10 +134,11 @@ static int ipecamera_data_callback(void *user, pcilib_dma_flags_t flags, size_t
#endif /* IPECAMERA_BUG_INCOMPLETE_PACKETS */
if ((bufsize >= 8)&&(!memcmp(buf, frame_magic, sizeof(frame_magic)))) {
+ // size_t first_line = ((uint32_t*)buf)[4] & 0x7FF;
size_t n_lines = ((uint32_t*)buf)[5] & 0x7FF;
ipecamera_compute_buffer_size(ctx, n_lines);
- ctx->frame[ctx->buffer_pos].event.info.seqnum = ((uint32_t*)buf)[6] & 0x1FFFFFF;
+ ctx->frame[ctx->buffer_pos].event.info.seqnum = ((uint32_t*)buf)[6] & 0xFFFFFF;
ctx->frame[ctx->buffer_pos].event.info.offset = (((uint32_t*)buf)[7] & 0xFFFFFF) * 80;
gettimeofday(&ctx->frame[ctx->buffer_pos].event.info.timestamp, NULL);
} else {