From 3257e362cf8c35e0a7d9680a1f95190032456461 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Sun, 17 Jun 2012 21:45:57 +0200 Subject: [PATCH] dont fail with audio files --- oxtimelines/timeline.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/oxtimelines/timeline.py b/oxtimelines/timeline.py index 40aec7c..7f277dc 100644 --- a/oxtimelines/timeline.py +++ b/oxtimelines/timeline.py @@ -289,6 +289,13 @@ class Timelines(): self.file_frame_n.append(int(duration * FPS)) self.file_points.append(points) offset += duration + #input did not have any video, dont try to render video timelines + if self.render_video and not video.video: + self.modes = ['audio'] + self.render_antialias = \ + self.render_slitscan = \ + self.render_keyframes = \ + self.render_video = False if not self.points: self.in_frame = 0 @@ -323,6 +330,7 @@ class Timelines(): # remove tiles from previous run if not self.points: + #for mode in filter(lambda m: m!= 'audio', self.modes): for mode in self.modes: type = 'png' if mode == 'data' else 'jpg' tiles = glob('%s/timeline%s%dp*.%s' % (self.tile_path, mode, self.large_tile_h, type)) @@ -510,6 +518,8 @@ class Timelines(): is_last_tile = self.frame_i == self.frame_n - 1 if large_tile_x == self.large_tile_w - 1 or is_last_tile: self._save_tile('audio', large_tile_i) + if not self.render_video: + self.large_tile_i = large_tile_i def _divide(self, num, by): # divide(100, 3) -> [33, 33, 34]