From 1650962c8af7770d771ec89456895f72dd899955 Mon Sep 17 00:00:00 2001 From: Pozitronik Date: Mon, 11 Mar 2024 20:10:08 +0400 Subject: [PATCH] Do not show the same frame, just wait for a next iteration --- sinner/gui/GUIModel.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sinner/gui/GUIModel.py b/sinner/gui/GUIModel.py index 56f78555..d6416fcf 100644 --- a/sinner/gui/GUIModel.py +++ b/sinner/gui/GUIModel.py @@ -483,6 +483,7 @@ def _process_frame(self, frame_index: int) -> float | None: return frame_render_time.execution_time def _show_frames(self) -> None: + last_shown_frame_index: int = -1 if self.Player: while self._event_playback.is_set(): start_time = time.perf_counter() @@ -492,8 +493,9 @@ def _show_frames(self) -> None: self.update_status("No more frames in the timeline") self._event_playback.clear() break - if n_frame is not None: + if n_frame is not None and n_frame.index != last_shown_frame_index: self.Player.show_frame(n_frame.frame) + last_shown_frame_index = n_frame.index if self.TimeLine.last_returned_index is None: self._status("Time position", "There are no ready frames") else: