diff options
-rw-r--r-- | source/blender/blenkernel/BKE_sequencer.h | 1 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/seqprefetch.c | 9 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_jobs.c | 4 |
3 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_sequencer.h b/source/blender/blenkernel/BKE_sequencer.h index 58154006513..f89a2d631ac 100644 --- a/source/blender/blenkernel/BKE_sequencer.h +++ b/source/blender/blenkernel/BKE_sequencer.h @@ -369,6 +369,7 @@ bool BKE_sequencer_cache_is_full(struct Scene *scene); * ********************************************************************** */ void BKE_sequencer_prefetch_start(const SeqRenderData *context, float cfra, float cost); +void BKE_sequencer_prefetch_stop_all(); void BKE_sequencer_prefetch_stop(struct Scene *scene); void BKE_sequencer_prefetch_free(struct Scene *scene); bool BKE_sequencer_prefetch_need_redraw(struct Main *bmain, struct Scene *scene); diff --git a/source/blender/blenkernel/intern/seqprefetch.c b/source/blender/blenkernel/intern/seqprefetch.c index d87c2e1d898..f00d517940a 100644 --- a/source/blender/blenkernel/intern/seqprefetch.c +++ b/source/blender/blenkernel/intern/seqprefetch.c @@ -42,6 +42,7 @@ #include "BKE_anim_data.h" #include "BKE_animsys.h" #include "BKE_context.h" +#include "BKE_global.h" #include "BKE_layer.h" #include "BKE_lib_id.h" #include "BKE_main.h" @@ -242,6 +243,14 @@ static void seq_prefetch_update_area(PrefetchJob *pfjob) } } +void BKE_sequencer_prefetch_stop_all(void) +{ + /*TODO(Richard): Use wm_jobs for prefetch, or pass main. */ + for (Scene *scene = G.main->scenes.first; scene; scene = scene->id.next) { + BKE_sequencer_prefetch_stop(scene); + } +} + /* Use also to update scene and context changes * This function should almost always be called by cache invalidation, not directly. */ diff --git a/source/blender/windowmanager/intern/wm_jobs.c b/source/blender/windowmanager/intern/wm_jobs.c index 245a8f28fec..c10f03f3dab 100644 --- a/source/blender/windowmanager/intern/wm_jobs.c +++ b/source/blender/windowmanager/intern/wm_jobs.c @@ -35,6 +35,7 @@ #include "BKE_context.h" #include "BKE_global.h" +#include "BKE_sequencer.h" #include "WM_api.h" #include "WM_types.h" @@ -558,6 +559,9 @@ void WM_jobs_kill_all(wmWindowManager *wm) while ((wm_job = wm->jobs.first)) { wm_jobs_kill_job(wm, wm_job); } + + /* This job will be automatically restarted */ + BKE_sequencer_prefetch_stop_all(); } /* wait until every job ended, except for one owner (used in undo to keep screen job alive) */ |