== Sequencer ==
authorPeter Schlaile <peter@schlaile.de>
Sun, 8 Aug 2010 13:55:30 +0000 (13:55 +0000)
committerPeter Schlaile <peter@schlaile.de>
Sun, 8 Aug 2010 13:55:30 +0000 (13:55 +0000)
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
source/blender/blenkernel/intern/sequencer.c
source/blender/blenloader/intern/readfile.c
source/blender/editors/space_outliner/outliner.c
source/blender/makesdna/DNA_sequence_types.h

index c117f51c072fb8c7a7a863d6896b6594d2597e7a..1e1ace0f75811e3e1bb392c7baf51c67c9b14f09 100644 (file)
@@ -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;
                        }
index 7f3057bba96963abec9646072c76b36da4ccd0ea..9d0fcc95c7c6236bc8aa131015f8a05f162b3111 100644 (file)
@@ -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);
        }
index d5eb03dd220d5d798b1921dc06398e5383bb17af..e36b73189e6dfd052de02d6d36630dbe7abee146 100644 (file)
@@ -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 ||
index 95435fb9ce29dfd7d3a787c431532dc38d2eefc6..fc08f3390c9781bb2620ed75ab8634e78bb98371 100644 (file)
@@ -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";
                        }
index f9d482b2159d5a77565916dfcce4d2147c52f986..d51dec97351933fd1377d99b50559d0779ff2d67 100644 (file)
@@ -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;