From 77a3abf4a67932a14e24a3b2e326ddad4fee3f5f Mon Sep 17 00:00:00 2001 From: Martijn Braam Date: Mon, 27 Jun 2022 15:40:44 +0200 Subject: [PATCH] Only disable flash when flashing is enabled If the flash was disabled and screne flash is used it will try to set the screen brightness back to the original value. Because the check for mp_flash_enable and mp_flash_disable is different there's cases where enable wasn't run but disable is, causing it to use the initial zero brightness as the restore value. --- src/io_pipeline.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/io_pipeline.c b/src/io_pipeline.c index 12a26a8..9312299 100644 --- a/src/io_pipeline.c +++ b/src/io_pipeline.c @@ -575,7 +575,7 @@ on_frame(MPBuffer buffer, void *_data) mp_camera_start_capture(info->camera); // Disable flash - if (info->flash) { + if (info->flash && flash_enabled) { mp_flash_disable(info->flash); }