From 370f3c805cca21d05d584b4ecc0ff95104c21642 Mon Sep 17 00:00:00 2001 From: Rene Zeldenthuis Date: Sun, 6 Nov 2022 20:44:50 +0100 Subject: [PATCH] - remove old frames from the frame buffer before sending snapshot --- src/main.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 4aca079..586ea96 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -149,7 +149,11 @@ void handle_snapshot() return; } - cam.run(); + // Remove old images stored in the framebuffer + auto frame_buffers = atoi(frame_buffers_val); + while (frame_buffers--) + cam.run(); + auto fb_len = cam.getSize(); auto fb = (const char*)cam.getfb(); if (fb == nullptr) @@ -188,7 +192,6 @@ void on_config_saved() log_v("on_config_saved"); // Set flash led intensity analogWrite(LED_FLASH, atoi(flash_led_intensity_val)); - config_changed = true; }