From ea24ff6e256d5dd824494658ad55251453327526 Mon Sep 17 00:00:00 2001 From: rolux Date: Fri, 26 Jul 2013 15:34:42 +0200 Subject: [PATCH] fix a bug where the last cut would be dropped --- oxtimelines/timeline.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/oxtimelines/timeline.py b/oxtimelines/timeline.py index 21b6a4d..b4ef6de 100644 --- a/oxtimelines/timeline.py +++ b/oxtimelines/timeline.py @@ -662,12 +662,11 @@ class Timelines(): if self.render_antialias: self._save_full_tile('antialias') if self.cuts_path: - # remove cuts at max_cut_len - self.cuts = filter(lambda x: x not in self.no_cuts, self.cuts) + # remove cuts at first frame and last frame and all cuts at max_cut_len + self.cuts = filter(lambda x: x not in [0, self.frame_n] + self.no_cuts, self.cuts) with open(self.cuts_path, 'w') as f: - # remove 0 and frame_n from cuts # avoid float rounding artefacts - f.write('[' + ', '.join(map(lambda x: '%.2f' % (x / FPS), self.cuts[1:-1])) + ']') + f.write('[' + ', '.join(map(lambda x: '%.2f' % (x / FPS), self.cuts)) + ']') if self.render_audio: self._render_audio(self.volume) if not self.render_video: