fix duration

This commit is contained in:
j 2017-03-02 22:10:54 +01:00
parent cd2fe0cf8a
commit 79dde0756f

View file

@ -185,8 +185,8 @@ def sequence(seq, letter):
'music': [],
}
duration = 0
MAX_DURATION = 65 * 2
MIN_DURATION = 56 * 2
MAX_DURATION = 60 * 2 + 5
MIN_DURATION = 60 * 2 - 4
while duration < MAX_DURATION and not duration >= MIN_DURATION:
# clip duration: 1-10
n = seq()
@ -208,9 +208,11 @@ def sequence(seq, letter):
clip = random_choice(seq, clips_n[tag])
duration += clip['duration']
result['clips'].append(clip.copy())
'''
for clip in result['clips']:
if seq() == 0:
clip['black'] = True
'''
# text overlay
position = last_text = 0
@ -267,7 +269,6 @@ def sequence(seq, letter):
and result[track][-1].get('blank') \
and result[track][-1]['duration'] > clip['duration']:
result[track][-1]['duration'] -= (position-duration)
print('one last alignment')
position = duration
if position <= duration:
result[track].append(clip)