[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [30270] branches/soc-2010-nexyon/source/ blender: Dirty hack fix for:

Joerg Mueller nexyon at gmail.com
Tue Jul 13 17:14:29 CEST 2010


Revision: 30270
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=30270
Author:   nexyon
Date:     2010-07-13 17:14:29 +0200 (Tue, 13 Jul 2010)

Log Message:
-----------
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

Modified Paths:
--------------
    branches/soc-2010-nexyon/source/blender/blenkernel/intern/sequencer.c
    branches/soc-2010-nexyon/source/blender/editors/space_sequencer/sequencer_edit.c

Modified: branches/soc-2010-nexyon/source/blender/blenkernel/intern/sequencer.c
===================================================================
--- branches/soc-2010-nexyon/source/blender/blenkernel/intern/sequencer.c	2010-07-13 13:59:34 UTC (rev 30269)
+++ branches/soc-2010-nexyon/source/blender/blenkernel/intern/sequencer.c	2010-07-13 15:14:29 UTC (rev 30270)
@@ -517,6 +517,31 @@
 	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 @@
 					new_tstripdata(seq);
 				}
 			}
+			seq_update_sound_bounds_recursive(scene, seq);
 		}
 		calc_sequence_disp(scene, seq);
 	}

Modified: branches/soc-2010-nexyon/source/blender/editors/space_sequencer/sequencer_edit.c
===================================================================
--- branches/soc-2010-nexyon/source/blender/editors/space_sequencer/sequencer_edit.c	2010-07-13 13:59:34 UTC (rev 30269)
+++ branches/soc-2010-nexyon/source/blender/editors/space_sequencer/sequencer_edit.c	2010-07-13 15:14:29 UTC (rev 30270)
@@ -827,7 +827,7 @@
 		}
 		
 		reload_sequence_new_file(scene, seqn, FALSE);
-		calc_sequence(scene, seq);
+		calc_sequence(scene, seqn);
 	}
 	return seqn;
 }





More information about the Bf-blender-cvs mailing list