Merging revision 30264:30270 from my GSoC branch to trunk, logs:
authorJoerg Mueller <nexyon@gmail.com>
Tue, 13 Jul 2010 15:19:15 +0000 (15:19 +0000)
committerJoerg Mueller <nexyon@gmail.com>
Tue, 13 Jul 2010 15:19:15 +0000 (15:19 +0000)
Bugfix for [#22284] Blender cursor gets stuck in the timeline when scrubbing (jack transport).

Dirty hack fix for:
* [#22366] Cutting audio and meta strips with audio does not actually cut audio
* [#22639] Audio not clipped to meta bounds

Also fixed a seemingly symptomless bug in sequencer_edit.c

source/blender/blenkernel/intern/sequencer.c
source/blender/editors/screen/screen_ops.c
source/blender/editors/space_sequencer/sequencer_edit.c
source/blender/windowmanager/intern/wm_event_system.c

index 4a5d08f..e8f8c2f 100644 (file)
@@ -517,6 +517,31 @@ void calc_sequence_disp(Scene *scene, Sequence *seq)
        seq_update_sound(scene, seq);
 }
 
+static void seq_update_sound_bounds_recursive(Scene *scene, Sequence *metaseq)
+{
+       Sequence *seq;
+
+       /* for sound we go over full meta tree to update bounds of the sound strips,
+          since sound is played outside of evaluating the imbufs, */
+       for(seq=metaseq->seqbase.first; seq; seq=seq->next) {
+               if(seq->type == SEQ_META) {
+                       seq_update_sound_bounds_recursive(scene, seq);
+               }
+               else if((seq->type == SEQ_SOUND) || (seq->type == SEQ_SCENE)) {
+                       if(seq->scene_sound) {
+                               int startofs = seq->startofs;
+                               int endofs = seq->endofs;
+                               if(seq->startofs + seq->start < metaseq->start + metaseq->startofs)
+                                       startofs = metaseq->start + metaseq->startofs - seq->start;
+
+                               if(seq->start + seq->len - seq->endofs > metaseq->start + metaseq->len - metaseq->endofs)
+                                       endofs = seq->start + seq->len - metaseq->start - metaseq->len + metaseq->endofs;
+                               sound_move_scene_sound(scene, seq->scene_sound, seq->start + startofs, seq->start+seq->len - endofs, startofs);
+                       }
+               }
+       }
+}
+
 void calc_sequence(Scene *scene, Sequence *seq)
 {
        Sequence *seqm;
@@ -576,6 +601,7 @@ void calc_sequence(Scene *scene, Sequence *seq)
                                        new_tstripdata(seq);
                                }
                        }
+                       seq_update_sound_bounds_recursive(scene, seq);
                }
                calc_sequence_disp(scene, seq);
        }
index 5aeb50b..50a5414 100644 (file)
@@ -2448,7 +2448,7 @@ static int screen_animation_step(bContext *C, wmOperator *op, wmEvent *event)
                else sync= (scene->flag & SCE_FRAME_DROP);
                
                if((scene->audio.flag & AUDIO_SYNC) && !(sad->flag & ANIMPLAY_FLAG_REVERSE) && finite(time = sound_sync_scene(scene)))
-                       scene->r.cfra = floor(time * FPS);
+                       scene->r.cfra = round(time * FPS);
                else
                {
                        if(sync) {
index 19b8e9d..d3d2fd7 100644 (file)
@@ -827,7 +827,7 @@ static Sequence *cut_seq_hard(Scene *scene, Sequence * seq, int cutframe)
                }
                
                reload_sequence_new_file(scene, seqn, FALSE);
-               calc_sequence(scene, seq);
+               calc_sequence(scene, seqn);
        }
        return seqn;
 }
index b01d2b2..3077b25 100644 (file)
@@ -1598,7 +1598,7 @@ void wm_event_do_handlers(bContext *C)
                                        }
                                        
                                        if(playing == 0) {
-                                               int ncfra = floor(sound_sync_scene(scene) * FPS);
+                                               int ncfra = round(sound_sync_scene(scene) * FPS);
                                                if(ncfra != scene->r.cfra)      {
                                                        scene->r.cfra = ncfra;
                                                        ED_update_for_newframe(C, 1);