From 0c54337755fb51217701f49396f6534ec7ec3438 Mon Sep 17 00:00:00 2001 From: Peter Schlaile Date: Sun, 8 Aug 2010 13:55:30 +0000 Subject: == 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). --- source/blender/blenkernel/intern/seqeffects.c | 21 +++++---------------- source/blender/blenkernel/intern/sequencer.c | 12 +++--------- 2 files changed, 8 insertions(+), 25 deletions(-) (limited to 'source/blender/blenkernel') 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); } -- cgit v1.2.3