From c62ac5950f32694366bec2e8181e9173a9bfaa78 Mon Sep 17 00:00:00 2001 From: Martijn Braam Date: Sat, 22 Jul 2023 16:01:52 +0200 Subject: [PATCH] Decouple capture frame counter from the burst length --- src/process_pipeline.c | 4 ++-- src/state.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/process_pipeline.c b/src/process_pipeline.c index a858d0f..ff03e42 100644 --- a/src/process_pipeline.c +++ b/src/process_pipeline.c @@ -822,10 +822,9 @@ process_image(MPPipeline *pipeline, const MPBuffer *buffer) GdkTexture *thumb = process_image_for_preview(image); if (state_proc.captures_remaining > 0) { - int count = state_proc.burst_length - state_proc.captures_remaining; --state_proc.captures_remaining; - process_image_for_capture(image, count); + process_image_for_capture(image, state_proc.counter++); if (state_proc.captures_remaining == 0) { assert(thumb); @@ -885,6 +884,7 @@ capture() strcpy(burst_dir, tempdir); state_proc.captures_remaining = state_proc.burst_length; + state_proc.counter = 0; } void diff --git a/src/state.h b/src/state.h index 9d4d1a2..a3452b1 100644 --- a/src/state.h +++ b/src/state.h @@ -76,6 +76,7 @@ typedef struct state_proc { int burst_length; int captures_remaining; + int counter; int preview_width; int preview_height;