From 7c7bc06b7fc7fb8e8c8a9304275d2c438237178b Mon Sep 17 00:00:00 2001 From: jb-alvarado Date: Sun, 20 Mar 2022 22:33:55 +0100 Subject: [PATCH] clone node before set seek --- src/input/playlist.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/input/playlist.rs b/src/input/playlist.rs index 390395f7..35ec2473 100644 --- a/src/input/playlist.rs +++ b/src/input/playlist.rs @@ -159,9 +159,13 @@ impl CurrentProgram { if item.begin.unwrap() + item.out - item.seek > time_sec { *self.init.lock().unwrap() = false; self.index = i + 1; - item.seek = time_sec - item.begin.unwrap(); - self.current_node = handle_list_init(item.clone()); + // de-instance node to preserve original values in list + let mut node_clone = item.clone(); + node_clone.seek = time_sec - node_clone.begin.unwrap(); + + self.current_node = handle_list_init(node_clone); + break; } }