Skip to content

Commit

Permalink
fix: don't log/error when sending frames while paused
Browse files Browse the repository at this point in the history
  • Loading branch information
lukexor committed Jun 22, 2024
1 parent d743b31 commit 50825f8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tetanes/src/nes/emulation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,11 @@ impl State {
when: Instant::now() + park_timeout,
});
if self.control_deck.is_running() && self.run_state.paused() {
self.send_frame();
// Only send a frame if there's space, which means the renderer consumed previous
// frames and may need the current buffer to redraw for e.g. resizing
if let Ok(mut frame) = self.frame_tx.try_send_ref() {
self.control_deck.frame_buffer_into(&mut frame);
}
}
thread::park_timeout(park_timeout);
return;
Expand Down

0 comments on commit 50825f8

Please sign in to comment.