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.
This commit is contained in:
@@ -24,6 +24,8 @@
|
||||
#include <QMetaObject>
|
||||
|
||||
#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
|
||||
|
||||
Reference in New Issue
Block a user