From 8b6ce77f163cf0822af8a107a213e984ba4b3e97 Mon Sep 17 00:00:00 2001 From: Richard Antalik Date: Tue, 17 Nov 2020 13:00:00 +0100 Subject: [PATCH] VSE: Fix prefetch initialization sequence In 8d1978a8e013 bmain entry is updated when prefetching is started, but this must be done before seq_prefetch_update_context(). Otherwise created cache keys will be incorrect. This happens immediately after prefetch is started. When it's refreshed problem goes away. Reviewed By: sergey Differential Revision: https://developer.blender.org/D9581 --- source/blender/sequencer/intern/prefetch.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/blender/sequencer/intern/prefetch.c b/source/blender/sequencer/intern/prefetch.c index 65b2b6c02cf..ec0bdad28e9 100644 --- a/source/blender/sequencer/intern/prefetch.c +++ b/source/blender/sequencer/intern/prefetch.c @@ -505,8 +505,6 @@ static PrefetchJob *seq_prefetch_start(const SeqRenderData *context, float cfra) seq_prefetch_init_depsgraph(pfjob); } } - seq_prefetch_update_scene(context->scene); - seq_prefetch_update_context(context); pfjob->bmain = context->bmain; pfjob->cfra = cfra; @@ -516,6 +514,9 @@ static PrefetchJob *seq_prefetch_start(const SeqRenderData *context, float cfra) pfjob->stop = false; pfjob->running = true; + seq_prefetch_update_scene(context->scene); + seq_prefetch_update_context(context); + BLI_threadpool_remove(&pfjob->threads, pfjob); BLI_threadpool_insert(&pfjob->threads, pfjob);