summaryrefslogtreecommitdiffstats
path: root/ipecamera/data.c
diff options
context:
space:
mode:
Diffstat (limited to 'ipecamera/data.c')
-rw-r--r--ipecamera/data.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/ipecamera/data.c b/ipecamera/data.c
index fb29018..bdc067e 100644
--- a/ipecamera/data.c
+++ b/ipecamera/data.c
@@ -61,6 +61,13 @@ inline static int ipecamera_decode_frame(ipecamera_t *ctx, pcilib_event_id_t eve
res = ufo_decoder_decode_frame(ctx->ipedec, ctx->buffer + buf_ptr * ctx->padded_size, ctx->raw_size, pixels, &ctx->frame[buf_ptr].event.meta);
// puts("done\n");
if (!res) {
+#ifdef IPECAMERA_DEBUG_BROKEN_FRAMES
+ char name[128];
+ sprintf(name, "%s/broken.%4lu", IPECAMERA_DEBUG_BROKEN_FRAMES, ctx->event_id);
+ FILE *f = fopen("/mnt/frames/broken", "w");
+ fwrite(ctx->buffer + buf_ptr * ctx->padded_size, ctx->raw_size, 1, f);
+ fclose(f);
+#endif /* IPECAMERA_DEBUG_BROKEN_FRAMES */
err = PCILIB_ERROR_FAILED;
ctx->frame[buf_ptr].event.image_broken = err;
goto ready;