From 01f54494467967ed4ef86df73009ae01846d1b0f Mon Sep 17 00:00:00 2001 From: jb-alvarado Date: Tue, 10 May 2022 11:26:01 +0200 Subject: [PATCH] add tollerance to next_start on last clip --- src/input/playlist.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/input/playlist.rs b/src/input/playlist.rs index 3b1d1f4c..f46a4ae3 100644 --- a/src/input/playlist.rs +++ b/src/input/playlist.rs @@ -134,7 +134,11 @@ impl CurrentProgram { duration = self.current_node.duration } - let next_start = self.current_node.begin.unwrap() - start_sec + duration + delta; + let mut next_start = self.current_node.begin.unwrap() - start_sec + duration + delta; + + if self.index.load(Ordering::SeqCst) == self.nodes.lock().unwrap().len() - 1 { + next_start += self.config.general.stop_threshold; + } if next_start >= target_length || is_close(total_delta, 0.0, 2.0)