summaryrefslogtreecommitdiffstats
path: root/reader.c
diff options
context:
space:
mode:
Diffstat (limited to 'reader.c')
-rw-r--r--reader.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/reader.c b/reader.c
index 2c95b13..e293005 100644
--- a/reader.c
+++ b/reader.c
@@ -234,8 +234,18 @@ static int ipecamera_data_callback(void *user, pcilib_dma_flags_t flags, size_t
return -PCILIB_ERROR_TOOBIG;
}
- if (bufsize)
+ if (bufsize) {
+#ifdef IPECAMERA_BUG_REPEATING_DATA
+ if ((bufsize > 16)&&(ctx->cur_size > 16)) {
+ if (!memcmp(ctx->buffer + ctx->buffer_pos * ctx->padded_size + ctx->cur_size - 16, buf, 16)) {
+ pcilib_warning("Skipping repeating bytes at offset %zu of frame %zu", ctx->cur_size, ctx->event_id);
+ buf += 16;
+ bufsize -=16;
+ }
+ }
+#endif /* IPECAMERA_BUG_REPEATING_DATA */
memcpy(ctx->buffer + ctx->buffer_pos * ctx->padded_size + ctx->cur_size, buf, bufsize);
+ }
}
ctx->cur_size += bufsize;