diff options
author | Peter Schlaile <peter@schlaile.de> | 2010-08-08 17:55:30 +0400 |
---|---|---|
committer | Peter Schlaile <peter@schlaile.de> | 2010-08-08 17:55:30 +0400 |
commit | 0c54337755fb51217701f49396f6534ec7ec3438 (patch) | |
tree | 2af18034af70ed5a7f8d02db28e44490988f6a45 | |
parent | 015c23b86ddafc7b32368fb981b6e4527afe33b1 (diff) |
== Sequencer ==
This fixes: [#23184] Problems with speed control effect strip in the
video sequence editor
Also: got rid of tstripdata caches in DNA.
Fixes some potential crashes in SEQ_IMAGE rendering (s_elem wasn't
checked for NULL).
-rw-r--r-- | source/blender/blenkernel/intern/seqeffects.c | 21 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/sequencer.c | 12 | ||||
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 5 | ||||
-rw-r--r-- | source/blender/editors/space_outliner/outliner.c | 2 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_sequence_types.h | 14 |
5 files changed, 8 insertions, 46 deletions
diff --git a/source/blender/blenkernel/intern/seqeffects.c b/source/blender/blenkernel/intern/seqeffects.c index c117f51c072..1e1ace0f758 100644 --- a/source/blender/blenkernel/intern/seqeffects.c +++ b/source/blender/blenkernel/intern/seqeffects.c @@ -2968,22 +2968,11 @@ void sequence_effect_speed_rebuild_map(Scene *scene, Sequence * seq, int force) fallback_fac = 1.0; - /* if there is no IPO, try to make retiming easy by stretching the + /* if there is no fcurve, try to make retiming easy by stretching the strip */ - // XXX old animation system - seq if (!fcu && seq->seq1->enddisp != seq->seq1->start && seq->seq1->len != 0) { fallback_fac = (float) seq->seq1->len / (float) (seq->seq1->enddisp - seq->seq1->start); - /* FIXME: this strip stretching gets screwed by stripdata - handling one layer up. - - So it currently works by enlarging, never by shrinking! - - (IPOs still work, if used correctly) - */ - if (fallback_fac > 1.0) { - fallback_fac = 1.0; - } } if ((v->flags & SEQ_SPEED_INTEGRATE) != 0) { @@ -3006,8 +2995,8 @@ void sequence_effect_speed_rebuild_map(Scene *scene, Sequence * seq, int force) cursor += facf; - if (cursor >= v->length) { - v->frameMap[cfra] = v->length - 1; + if (cursor >= seq->seq1->len) { + v->frameMap[cfra] = seq->seq1->len - 1; } else { v->frameMap[cfra] = cursor; v->lastValidFrame = cfra; @@ -3033,8 +3022,8 @@ void sequence_effect_speed_rebuild_map(Scene *scene, Sequence * seq, int force) facf = (float) cfra * fallback_fac; } facf *= v->globalSpeed; - if (facf >= v->length) { - facf = v->length - 1; + if (facf >= seq->seq1->len) { + facf = seq->seq1->len - 1; } else { v->lastValidFrame = cfra; } diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index 7f3057bba96..9d0fcc95c7c 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -899,7 +899,6 @@ static float give_stripelem_index(Sequence *seq, float cfra) { float nr; - if(seq->startdisp >cfra || seq->enddisp <= cfra) return -1; if(seq->len == 0) return -1; if(seq->flag&SEQ_REVERSE_FRAMES) { /*reverse frame in this sequence */ @@ -1993,7 +1992,7 @@ static ImBuf * seq_render_strip(Scene *scene, Sequence * seq, float cfra, } else if(seq->type == SEQ_IMAGE) { StripElem * s_elem = give_stripelem(seq, cfra); - if(ibuf == 0) { + if(ibuf == 0 && s_elem) { BLI_join_dirfile(name, seq->strip->dir, s_elem->name); BLI_path_abs(name, G.sce); @@ -2004,7 +2003,8 @@ static ImBuf * seq_render_strip(Scene *scene, Sequence * seq, float cfra, ibuf = copy_from_ibuf_still(seq,nr,seqrectx,seqrecty); } - if (ibuf == 0 && (ibuf=IMB_loadiffname(name, IB_rect))) { + if (ibuf == 0 && s_elem && + (ibuf = IMB_loadiffname(name, IB_rect))) { /* we don't need both (speed reasons)! */ if (ibuf->rect_float && ibuf->rect) imb_freerectImBuf(ibuf); @@ -3541,12 +3541,6 @@ static Sequence *seq_dupli(struct Scene *scene, Sequence *seq, int dupe_flag) // XXX: add F-Curve duplication stuff? - seqn->strip->tstripdata = 0; - seqn->strip->tstripdata_startstill = 0; - seqn->strip->tstripdata_endstill = 0; - seqn->strip->ibuf_startstill = 0; - seqn->strip->ibuf_endstill = 0; - if (seq->strip->crop) { seqn->strip->crop = MEM_dupallocN(seq->strip->crop); } diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index d5eb03dd220..e36b73189e6 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -4295,11 +4295,6 @@ static void direct_link_scene(FileData *fd, Scene *sce) seq->strip= newdataadr(fd, seq->strip); if(seq->strip && seq->strip->done==0) { seq->strip->done= 1; - seq->strip->tstripdata = 0; - seq->strip->tstripdata_startstill = 0; - seq->strip->tstripdata_endstill = 0; - seq->strip->ibuf_startstill = 0; - seq->strip->ibuf_endstill = 0; if(seq->type == SEQ_IMAGE || seq->type == SEQ_MOVIE || diff --git a/source/blender/editors/space_outliner/outliner.c b/source/blender/editors/space_outliner/outliner.c index 95435fb9ce2..fc08f3390c9 100644 --- a/source/blender/editors/space_outliner/outliner.c +++ b/source/blender/editors/space_outliner/outliner.c @@ -983,8 +983,6 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i else { if((seq->strip) && (seq->strip->stripdata)) te->name= seq->strip->stripdata->name; - else if((seq->strip) && (seq->strip->tstripdata) && (seq->strip->tstripdata->ibuf)) - te->name= seq->strip->tstripdata->ibuf->name; else te->name= "SQ None"; } diff --git a/source/blender/makesdna/DNA_sequence_types.h b/source/blender/makesdna/DNA_sequence_types.h index f9d482b2159..d51dec97351 100644 --- a/source/blender/makesdna/DNA_sequence_types.h +++ b/source/blender/makesdna/DNA_sequence_types.h @@ -44,15 +44,6 @@ typedef struct StripElem { char name[80]; } StripElem; -typedef struct TStripElem { - struct ImBuf *ibuf; - struct ImBuf *ibuf_comp; - struct TStripElem *se1, *se2, *se3; - short ok; - short flag; - int nr; -} TStripElem; - typedef struct StripCrop { int top; int bottom; @@ -95,11 +86,6 @@ typedef struct Strip { StripCrop *crop; StripTransform *transform; StripColorBalance *color_balance; - TStripElem *tstripdata; - TStripElem *tstripdata_startstill; - TStripElem *tstripdata_endstill; - struct ImBuf *ibuf_startstill; - struct ImBuf *ibuf_endstill; } Strip; |