diff --git a/ffplayout-engine/src/input/playlist.rs b/ffplayout-engine/src/input/playlist.rs index 3b382056..a7b8b51a 100644 --- a/ffplayout-engine/src/input/playlist.rs +++ b/ffplayout-engine/src/input/playlist.rs @@ -277,17 +277,18 @@ impl Iterator for CurrentProgram { // or we fill the gap with a dummy. let last_index = self.nodes.lock().unwrap().len() - 1; self.current_node = self.nodes.lock().unwrap()[last_index].clone(); - self.check_for_next_playlist(); - let new_node = self.nodes.lock().unwrap()[last_index].clone(); let new_length = new_node.begin.unwrap() + new_node.duration; + self.check_for_next_playlist(); + if new_length >= self.config.playlist.length_sec.unwrap() + self.config.playlist.start_sec.unwrap() { self.init_clip(); } else { + // fill missing length from playlist let mut current_time = get_sec(); let (_, total_delta) = get_delta(&self.config, ¤t_time); let mut duration = DUMMY_LEN;