diff options
author | Richard Antalik <richardantalik@gmail.com> | 2021-01-26 19:41:49 +0300 |
---|---|---|
committer | Richard Antalik <richardantalik@gmail.com> | 2021-01-26 19:50:44 +0300 |
commit | c9672084601e1563763ccc5b89d3c0c6bfd1c630 (patch) | |
tree | b40864f3488129562682f5067bb28aeafd09f5e2 /source | |
parent | 41979fc03b93ba8d55002311569536bf8c9ee983 (diff) |
Fix T79922: Cache of meta strip not invalidated
Meta strip cache is not invalidated if strip inside of meta strip is
invalidated.
Find all metastrips that contain invalidated strip and invalidate them
recursively.
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D10192
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/sequencer/intern/strip_relations.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/source/blender/sequencer/intern/strip_relations.c b/source/blender/sequencer/intern/strip_relations.c index 18ae21e3a65..1a2ff08bd08 100644 --- a/source/blender/sequencer/intern/strip_relations.c +++ b/source/blender/sequencer/intern/strip_relations.c @@ -127,17 +127,49 @@ static void sequence_invalidate_cache(Scene *scene, SEQ_prefetch_stop(scene); } +/* Find metastrips that contain invalidated_seq and invalidate them. */ +static bool seq_relations_find_and_invalidate_metas(Scene *scene, + Sequence *invalidated_seq, + Sequence *meta_seq) +{ + ListBase *seqbase; + + if (meta_seq == NULL) { + Editing *ed = SEQ_editing_get(scene, false); + seqbase = &ed->seqbase; + } + else { + seqbase = &meta_seq->seqbase; + } + + LISTBASE_FOREACH (Sequence *, seq, seqbase) { + if (seq->type == SEQ_TYPE_META) { + if (seq_relations_find_and_invalidate_metas(scene, invalidated_seq, seq)) { + sequence_invalidate_cache(scene, seq, true, SEQ_CACHE_ALL_TYPES); + return true; + } + } + if (seq == invalidated_seq && meta_seq != NULL) { + sequence_invalidate_cache(scene, meta_seq, true, SEQ_CACHE_ALL_TYPES); + return true; + } + } + return false; +} + void SEQ_relations_invalidate_cache_in_range(Scene *scene, Sequence *seq, Sequence *range_mask, int invalidate_types) { seq_cache_cleanup_sequence(scene, seq, range_mask, invalidate_types, true); + seq_relations_find_and_invalidate_metas(scene, seq, NULL); } void SEQ_relations_invalidate_cache_raw(Scene *scene, Sequence *seq) { sequence_invalidate_cache(scene, seq, true, SEQ_CACHE_ALL_TYPES); + seq_relations_find_and_invalidate_metas(scene, seq, NULL); } void SEQ_relations_invalidate_cache_preprocessed(Scene *scene, Sequence *seq) @@ -147,6 +179,7 @@ void SEQ_relations_invalidate_cache_preprocessed(Scene *scene, Sequence *seq) true, SEQ_CACHE_STORE_PREPROCESSED | SEQ_CACHE_STORE_COMPOSITE | SEQ_CACHE_STORE_FINAL_OUT); + seq_relations_find_and_invalidate_metas(scene, seq, NULL); } void SEQ_relations_invalidate_cache_composite(Scene *scene, Sequence *seq) @@ -157,6 +190,7 @@ void SEQ_relations_invalidate_cache_composite(Scene *scene, Sequence *seq) sequence_invalidate_cache( scene, seq, true, SEQ_CACHE_STORE_COMPOSITE | SEQ_CACHE_STORE_FINAL_OUT); + seq_relations_find_and_invalidate_metas(scene, seq, NULL); } void SEQ_relations_invalidate_dependent(Scene *scene, Sequence *seq) @@ -167,6 +201,7 @@ void SEQ_relations_invalidate_dependent(Scene *scene, Sequence *seq) sequence_invalidate_cache( scene, seq, false, SEQ_CACHE_STORE_COMPOSITE | SEQ_CACHE_STORE_FINAL_OUT); + seq_relations_find_and_invalidate_metas(scene, seq, NULL); } static void invalidate_scene_strips(Scene *scene, Scene *scene_target, ListBase *seqbase) |