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.
This commit is contained in:
parent
1341f91695
commit
15faab0082
Notes:
blender-bot
2023-02-14 08:19:24 +01:00
Referenced by issue #47135, VSE importing sound is one frame longer than video
|
@ -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 */
|
||||
|
|
Loading…
Reference in New Issue