[Bf-blender-cvs] [15faab0] master: Fix T47135: VSE importing sound is one frame longer than video.

Bastien Montagne noreply at git.blender.org
Fri Jan 8 09:41:45 CET 2016


Commit: 15faab0082d6de6ba1bb0787798f66f69a53dabe
Author: Bastien Montagne
Date:   Fri Jan 8 09:39:04 2016 +0100
Branches: master
https://developer.blender.org/rB15faab0082d6de6ba1bb0787798f66f69a53dabe

Fix T47135: VSE importing sound is one frame longer than video.

Issue is with rounding up of length reported by audaspace for audio part - when it matches nearly exactly
the actual video length, using ceil() would make it one frame longer. Now apply a small (0.0001 frame)
negative offset to prevent this effect.

===================================================================

M	source/blender/blenkernel/intern/sequencer.c

===================================================================

diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c
index 831f330..47c7cf6 100644
--- a/source/blender/blenkernel/intern/sequencer.c
+++ b/source/blender/blenkernel/intern/sequencer.c
@@ -5131,7 +5131,8 @@ Sequence *BKE_sequencer_add_sound_strip(bContext *C, ListBase *seqbasep, SeqLoad
 
 	/* basic defaults */
 	seq->strip = strip = MEM_callocN(sizeof(Strip), "strip");
-	seq->len = (int)ceil((double)info.length * FPS);
+	/* We add a very small negative offset here, because ceil(132.0) == 133.0, not nice with videos, see T47135. */
+	seq->len = (int)ceil((double)info.length * FPS - 1e-4);
 	strip->us = 1;
 
 	/* we only need 1 element to store the filename */




More information about the Bf-blender-cvs mailing list