Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Antalik <richardantalik@gmail.com>2020-05-12 23:50:33 +0300
committerRichard Antalik <richardantalik@gmail.com>2020-05-13 00:13:18 +0300
commitbe69f23b687ac0698fb95a28d007ee2e6b1b4eb5 (patch)
tree879805ea8479eb16bf15f1036d1c7b8d3cce7061 /source/blender/blenkernel/intern/seqprefetch.c
parent4930eb15f72cff2be0591ac473fa6560430a296b (diff)
Fix T70612: Sequencer Crash on enabling Prefetch
Disable (skip) preftching scene strips if they target 3D scene. Try to continue prefetching complete frame if disk cache images are found. Reviewed By: brecht Differential Revision: https://developer.blender.org/D7514
Diffstat (limited to 'source/blender/blenkernel/intern/seqprefetch.c')
-rw-r--r--source/blender/blenkernel/intern/seqprefetch.c65
1 files changed, 65 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/seqprefetch.c b/source/blender/blenkernel/intern/seqprefetch.c
index dabfd26f5b0..5eff6aaac90 100644
--- a/source/blender/blenkernel/intern/seqprefetch.c
+++ b/source/blender/blenkernel/intern/seqprefetch.c
@@ -334,6 +334,66 @@ void BKE_sequencer_prefetch_free(Scene *scene)
scene->ed->prefetch_job = NULL;
}
+static bool seq_prefetch_do_skip_frame(Scene *scene)
+{
+ Editing *ed = scene->ed;
+ PrefetchJob *pfjob = seq_prefetch_job_get(scene);
+ float cfra = pfjob->cfra + pfjob->num_frames_prefetched;
+ Sequence *seq_arr[MAXSEQ + 1];
+ int count = BKE_sequencer_get_shown_sequences(ed->seqbasep, 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_SCENE && (seq_arr[i]->flag & SEQ_SCENE_STRIPS) == 0) {
+ int cached_types = 0;
+
+ ibuf = BKE_sequencer_cache_get(ctx, seq_arr[i], cfra, SEQ_CACHE_STORE_FINAL_OUT, false);
+ if (ibuf != NULL) {
+ cached_types |= SEQ_CACHE_STORE_FINAL_OUT;
+ IMB_freeImBuf(ibuf);
+ ibuf = NULL;
+ }
+
+ ibuf = BKE_sequencer_cache_get(ctx, seq_arr[i], cfra, SEQ_CACHE_STORE_FINAL_OUT, false);
+ if (ibuf != NULL) {
+ cached_types |= SEQ_CACHE_STORE_COMPOSITE;
+ IMB_freeImBuf(ibuf);
+ ibuf = NULL;
+ }
+
+ ibuf = BKE_sequencer_cache_get(ctx, seq_arr[i], cfra, SEQ_CACHE_STORE_PREPROCESSED, false);
+ if (ibuf != NULL) {
+ cached_types |= SEQ_CACHE_STORE_PREPROCESSED;
+ IMB_freeImBuf(ibuf);
+ ibuf = NULL;
+ }
+
+ ibuf = BKE_sequencer_cache_get(ctx, seq_arr[i], cfra, SEQ_CACHE_STORE_RAW, false);
+ if (ibuf != NULL) {
+ cached_types |= SEQ_CACHE_STORE_RAW;
+ IMB_freeImBuf(ibuf);
+ ibuf = NULL;
+ }
+
+ if ((cached_types & (SEQ_CACHE_STORE_RAW | SEQ_CACHE_STORE_PREPROCESSED)) != 0) {
+ continue;
+ }
+
+ /* It is only safe to use these cache types if strip is last in stack. */
+ if (i == count - 1 &&
+ (cached_types & (SEQ_CACHE_STORE_PREPROCESSED | SEQ_CACHE_STORE_RAW)) != 0) {
+ continue;
+ }
+
+ return true;
+ }
+ }
+
+ return false;
+}
+
static void *seq_prefetch_frames(void *job)
{
PrefetchJob *pfjob = (PrefetchJob *)job;
@@ -358,6 +418,11 @@ static void *seq_prefetch_frames(void *job)
*/
pfjob->scene_eval->ed->prefetch_job = pfjob;
+ if (seq_prefetch_do_skip_frame(pfjob->scene)) {
+ pfjob->num_frames_prefetched++;
+ continue;
+ }
+
ImBuf *ibuf = BKE_sequencer_give_ibuf(
&pfjob->context_cpy, pfjob->cfra + pfjob->num_frames_prefetched, 0);
BKE_sequencer_cache_free_temp_cache(