Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2016-01-08 11:39:04 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2016-01-08 11:41:08 +0300
commit15faab0082d6de6ba1bb0787798f66f69a53dabe (patch)
tree2e6117873be8f669668ffaa15d3964d7b7d48877 /source/blender/blenkernel/intern/sequencer.c
parent1341f91695cf249d0f971c90c780dd9e76281e72 (diff)
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.
Diffstat (limited to 'source/blender/blenkernel/intern/sequencer.c')
-rw-r--r--source/blender/blenkernel/intern/sequencer.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c
index 831f330d78e..47c7cf6212a 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 */