diff options
author | Peter Schlaile <peter@schlaile.de> | 2010-07-20 00:01:18 +0400 |
---|---|---|
committer | Peter Schlaile <peter@schlaile.de> | 2010-07-20 00:01:18 +0400 |
commit | c7ce37471d8f7858735695ad92db1731fa2c1ae3 (patch) | |
tree | d248d1459dc16ced20cf7e898d6dc5ccfe350d29 | |
parent | 5095e97ea6d4be29c5fc803ea613cab69f5dd39c (diff) |
== Sequencer ==
Bugfix: free_imbuf_seq() was closing IMB anim handles on nearly every
change of RNA variables. This can be *very* slow, if you twiddle with
parameters during playback. Especially multicam editing...
Now: we close IMB anim handles only on refresh_all() and filepath
changes.
-rw-r--r-- | source/blender/blenkernel/BKE_sequencer.h | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/sequencer.c | 60 | ||||
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_edit.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_sequencer.c | 2 | ||||
-rw-r--r-- | source/blender/render/intern/source/pipeline.c | 2 |
5 files changed, 10 insertions, 60 deletions
diff --git a/source/blender/blenkernel/BKE_sequencer.h b/source/blender/blenkernel/BKE_sequencer.h index 002a1958a13..c5417e04780 100644 --- a/source/blender/blenkernel/BKE_sequencer.h +++ b/source/blender/blenkernel/BKE_sequencer.h @@ -191,13 +191,13 @@ void seq_dupe_animdata(struct Scene *scene, char *name_from, char *name_to); int shuffle_seq(struct ListBase * seqbasep, struct Sequence *test, struct Scene *evil_scene); int shuffle_seq_time(ListBase * seqbasep, struct Scene *evil_scene); int seqbase_isolated_sel_check(struct ListBase *seqbase); -void free_imbuf_seq(struct Scene *scene, struct ListBase * seqbasep, int check_mem_usage); +void free_imbuf_seq(struct Scene *scene, struct ListBase * seqbasep, int check_mem_usage, int keep_file_handles); struct Sequence *seq_dupli_recursive(struct Scene *scene, struct Sequence * seq, int dupe_flag); int seq_swap(struct Sequence *seq_a, struct Sequence *seq_b); void seq_update_sound(struct Scene* scene, struct Sequence *seq); void seq_update_muting(struct Scene* scene, struct Editing *ed); -void seqbase_sound_reload(Scene *scene, ListBase *seqbase); +void seqbase_sound_reload(struct Scene *scene, ListBase *seqbase); void seqbase_unique_name_recursive(ListBase *seqbasep, struct Sequence *seq); void seqbase_dupli_recursive(struct Scene *scene, ListBase *nseqbase, ListBase *seqbase, int dupe_flag); diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index de4e7a5ccbe..f631e42e05a 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -3267,59 +3267,8 @@ static void free_anim_seq(Sequence *seq) } } -#if 0 -static void free_imbuf_seq_except(Scene *scene, int cfra) -{ - Editing *ed= seq_give_editing(scene, FALSE); - Sequence *seq; - TStripElem *se; - int a; - - if(ed==NULL) return; - - SEQ_BEGIN(ed, seq) { - if(seq->strip) { - TStripElem * curelem = give_tstripelem(seq, cfra); - - for(a = 0, se = seq->strip->tstripdata; - a < seq->strip->len && se; a++, se++) { - if(se != curelem) { - free_imbuf_strip_elem(se); - } - } - for(a = 0, se = seq->strip->tstripdata_startstill; - a < seq->strip->startstill && se; a++, se++) { - if(se != curelem) { - free_imbuf_strip_elem(se); - } - } - for(a = 0, se = seq->strip->tstripdata_endstill; - a < seq->strip->endstill && se; a++, se++) { - if(se != curelem) { - free_imbuf_strip_elem(se); - } - } - if(seq->strip->ibuf_startstill) { - IMB_freeImBuf(seq->strip->ibuf_startstill); - seq->strip->ibuf_startstill = 0; - } - - if(seq->strip->ibuf_endstill) { - IMB_freeImBuf(seq->strip->ibuf_endstill); - seq->strip->ibuf_endstill = 0; - } - - if(seq->type==SEQ_MOVIE) - if(seq->startdisp > cfra || seq->enddisp < cfra) - free_anim_seq(seq); - free_proxy_seq(seq); - } - } - SEQ_END -} -#endif - -void free_imbuf_seq(Scene *scene, ListBase * seqbase, int check_mem_usage) +void free_imbuf_seq(Scene *scene, ListBase * seqbase, int check_mem_usage, + int keep_file_handles) { Sequence *seq; TStripElem *se; @@ -3374,14 +3323,15 @@ void free_imbuf_seq(Scene *scene, ListBase * seqbase, int check_mem_usage) seq->strip->ibuf_endstill = 0; } - if(seq->type==SEQ_MOVIE) + if(seq->type==SEQ_MOVIE && !keep_file_handles) free_anim_seq(seq); if(seq->type==SEQ_SPEED) { sequence_effect_speed_rebuild_map(scene, seq, 1); } } if(seq->type==SEQ_META) { - free_imbuf_seq(scene, &seq->seqbase, FALSE); + free_imbuf_seq(scene, &seq->seqbase, FALSE, + keep_file_handles); } if(seq->type==SEQ_SCENE) { /* FIXME: recurs downwards, diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index b320deb85e3..1b9b793ebdd 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -1415,7 +1415,7 @@ static int sequencer_refresh_all_exec(bContext *C, wmOperator *op) Scene *scene= CTX_data_scene(C); Editing *ed= seq_give_editing(scene, FALSE); - free_imbuf_seq(scene, &ed->seqbase, FALSE); + free_imbuf_seq(scene, &ed->seqbase, FALSE, FALSE); WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER, scene); diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c index 4becd3b065e..ec8b45db306 100644 --- a/source/blender/makesrna/intern/rna_sequencer.c +++ b/source/blender/makesrna/intern/rna_sequencer.c @@ -460,7 +460,7 @@ static void rna_Sequence_update(Main *bmain, Scene *scene, PointerRNA *ptr) { Editing *ed= seq_give_editing(scene, FALSE); - free_imbuf_seq(scene, &ed->seqbase, FALSE); + free_imbuf_seq(scene, &ed->seqbase, FALSE, TRUE); if(RNA_struct_is_a(ptr->type, &RNA_SoundSequence)) seq_update_sound(scene, ptr->data); diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index 258abe9a0fc..f27698752f1 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -2510,7 +2510,7 @@ static void do_render_seq(Render * re) if (recurs_depth == 0) { /* with nested scenes, only free on toplevel... */ Editing * ed = re->scene->ed; if (ed) { - free_imbuf_seq(re->scene, &ed->seqbase, TRUE); + free_imbuf_seq(re->scene, &ed->seqbase, TRUE, TRUE); } } } |