last fix still could give corrupt sound, rather then updating the sound info just...
authorCampbell Barton <ideasman42@gmail.com>
Sun, 4 Jul 2010 10:51:10 +0000 (10:51 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 4 Jul 2010 10:51:10 +0000 (10:51 +0000)
source/blender/blenkernel/intern/sequencer.c
source/blender/editors/space_sequencer/sequencer_edit.c

index d0678bc..e21901f 100644 (file)
@@ -549,8 +549,8 @@ void calc_sequence(Scene *scene, Sequence *seq)
                if(seq->type==SEQ_META) {
                        seqm= seq->seqbase.first;
                        if(seqm) {
-                               min= 1000000;
-                               max= -1000000;
+                               min=  MAXFRAME * 2;
+                               max= -MAXFRAME * 2;
                                while(seqm) {
                                        if(seqm->startdisp < min) min= seqm->startdisp;
                                        if(seqm->enddisp > max) max= seqm->enddisp;
index 1baf30c..9e52c2f 100644 (file)
@@ -2678,12 +2678,17 @@ static int sequencer_swap_data_exec(bContext *C, wmOperator *op)
                return OPERATOR_CANCELLED;
        }
 
+       sound_remove_scene_sound(scene, seq_act->scene_sound);
+       sound_remove_scene_sound(scene, seq_other->scene_sound);
+
+       seq_act->scene_sound= NULL;
+       seq_other->scene_sound= NULL;
+
        calc_sequence(scene, seq_act);
        calc_sequence(scene, seq_other);
 
-       /* sound needs to be moved */
-       if(seq_act->scene_sound) calc_sequence_disp(scene, seq_act);
-       if(seq_other->scene_sound) calc_sequence_disp(scene, seq_other);
+       if(seq_act->sound)              sound_add_scene_sound(scene, seq_act, seq_act->startdisp, seq_act->enddisp, seq_act->startofs + seq_act->anim_startofs);
+       if(seq_other->sound)    sound_add_scene_sound(scene, seq_other, seq_other->startdisp, seq_other->enddisp, seq_other->startofs + seq_other->anim_startofs);
 
        WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER, scene);