From bdb7c082e585d8c1a5a50083f1643a4be9931cb3 Mon Sep 17 00:00:00 2001 From: jb-alvarado Date: Sat, 9 Mar 2019 20:12:20 +0100 Subject: [PATCH] wrong indentation --- ffplayout.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/ffplayout.py b/ffplayout.py index 0b75d70e..4476ab64 100755 --- a/ffplayout.py +++ b/ffplayout.py @@ -617,12 +617,12 @@ class GetSourceIter: # check last modification from playlist mod_time = os.path.getmtime(self.json_file) if mod_time > self.last_mod_time: - with open(self.json_file) as f: + with open(self.json_file, 'r') as f: self.clip_nodes = json.load(f) - self.last_mod_time = mod_time - logger.info('open: ' + self.json_file) - validate_thread(self.clip_nodes) + self.last_mod_time = mod_time + logger.info('open: ' + self.json_file) + validate_thread(self.clip_nodes) else: # when we have no playlist for the current day, # then we generate a black clip @@ -666,6 +666,7 @@ class GetSourceIter: self.first, self.last_time = check_last_item( self.src_cmd, self.last_time, self.last) + # get start time from playlist if "begin" in self.clip_nodes: h, m, s = self.clip_nodes["begin"].split(':') if is_float(h) and is_float(m) and is_float(s): @@ -705,14 +706,14 @@ class GetSourceIter: break elif self.last_time and self.last_time < self.begin: if node == self.clip_nodes["program"][-1]: - last = True + self.last = True else: - last = False + self.last = False check_sync(self.begin) self.src_cmd, self.time_left = gen_input( - src, self.begin, duration, seek, out, last + src, self.begin, duration, seek, out, self.last ) if self.time_left is None: @@ -753,7 +754,7 @@ class GetSourceIter: # independent thread for clip preparation def play_clips(out_file, GetSourceIter): # send current file to buffer stdin - iter = GetSourceIter + iter = GetSourceIter() for src_cmd in iter.next(): if _pre_comp.copy: @@ -844,7 +845,7 @@ def main(): play_thread = Thread( name='play_clips', target=play_clips, args=( mbuffer.stdin, - GetSourceIter(), + GetSourceIter, ) ) play_thread.daemon = True