diff options
-rw-r--r-- | source/blender/sequencer/intern/prefetch.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/source/blender/sequencer/intern/prefetch.c b/source/blender/sequencer/intern/prefetch.c index 6deea305224..b0e9e3c5003 100644 --- a/source/blender/sequencer/intern/prefetch.c +++ b/source/blender/sequencer/intern/prefetch.c @@ -55,6 +55,7 @@ #include "SEQ_prefetch.h" #include "SEQ_render.h" +#include "SEQ_sequencer.h" #include "image_cache.h" #include "prefetch.h" @@ -358,18 +359,23 @@ void seq_prefetch_free(Scene *scene) scene->ed->prefetch_job = NULL; } -static bool seq_prefetch_do_skip_frame(Scene *scene) +/* Skip frame if we need to render 3D scene strip. Rendering 3D scene requires main lock or setting + * up render job that doesn't have API to do openGL renders which can be used for sequencer. */ +static bool seq_prefetch_do_skip_frame(PrefetchJob *pfjob, ListBase *seqbase) { - Editing *ed = scene->ed; - PrefetchJob *pfjob = seq_prefetch_job_get(scene); float cfra = seq_prefetch_cfra(pfjob); Sequence *seq_arr[MAXSEQ + 1]; - int count = seq_get_shown_sequences(ed->seqbasep, cfra, 0, seq_arr); + int count = seq_get_shown_sequences(seqbase, cfra, 0, seq_arr); SeqRenderData *ctx = &pfjob->context_cpy; ImBuf *ibuf = NULL; /* Disable prefetching 3D scene strips, but check for disk cache. */ for (int i = 0; i < count; i++) { + if (seq_arr[i]->type == SEQ_TYPE_META && + seq_prefetch_do_skip_frame(pfjob, &seq_arr[i]->seqbase)) { + return true; + } + if (seq_arr[i]->type == SEQ_TYPE_SCENE && (seq_arr[i]->flag & SEQ_SCENE_STRIPS) == 0) { int cached_types = 0; @@ -457,7 +463,8 @@ static void *seq_prefetch_frames(void *job) */ pfjob->scene_eval->ed->prefetch_job = pfjob; - if (seq_prefetch_do_skip_frame(pfjob->scene)) { + ListBase *seqbase = SEQ_active_seqbase_get(SEQ_editing_get(pfjob->scene, false)); + if (seq_prefetch_do_skip_frame(pfjob, seqbase)) { pfjob->num_frames_prefetched++; continue; } |