change positon from check_for_next_playlist to prevent index out of bounds, fix #140

This commit is contained in:
jb-alvarado 2022-06-26 16:45:50 +02:00
parent 77358fb140
commit a52be556bf

View File

@ -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, &current_time);
let mut duration = DUMMY_LEN;