From 9185b6fd60aef0e4fbbbb9c7eec65871abac51d5 Mon Sep 17 00:00:00 2001 From: Mike Solar Date: Fri, 3 Jul 2026 02:49:46 +0800 Subject: [PATCH] Auto-refresh viewer after LUT change without freezing After synchronously generating the new LUT processor, cancel any running background video cache jobs before invalidating the cache. This prevents the preview autocacher from re-rendering the entire timeline, which was causing the UI to freeze, while still updating the current visible frame with the new LUT. --- app/node/color/ociolut/ociolut.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/node/color/ociolut/ociolut.cpp b/app/node/color/ociolut/ociolut.cpp index ed025aa7c..17c4b24b1 100644 --- a/app/node/color/ociolut/ociolut.cpp +++ b/app/node/color/ociolut/ociolut.cpp @@ -24,6 +24,8 @@ #include #include "node/color/colormanager/colormanager.h" +#include "render/previewautocacher.h" +#include "render/rendermanager.h" namespace olive { @@ -179,6 +181,15 @@ void OCIOLutNode::GenerateProcessor() last_direction_ = direction; last_processor_ = processor; set_processor(processor); + + // The processor has changed. Cancel any background caching first so the + // preview autocacher doesn't try to re-cache the entire timeline, then + // invalidate the cache so the current frame re-renders with the new LUT. + PreviewAutoCacher *cacher = RenderManager::instance()->GetCacher(); + if (cacher) { + cacher->CancelVideoTasks(true); + } + InvalidateAll(kTextureInput); } } // namespace olive