From c68b777967c8d4ca2a803511a6ca0bd195329803 Mon Sep 17 00:00:00 2001 From: Leandro Nini Date: Tue, 22 Oct 2024 21:01:48 +0200 Subject: [PATCH] Fix few display issues --- src/player.cpp | 7 ++++--- src/player.h | 4 +++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/player.cpp b/src/player.cpp index eb98d7b..346894b 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -885,9 +885,10 @@ bool ConsolePlayer::open (void) int delay = isNTSC ? 16 : 20; m_thread = new std::thread([this](int delay) { - while (m_state == playerRunning) + while (m_state != playerStopped) { - updateDisplay(); + if (m_state == playerRunning) + updateDisplay(); std::this_thread::sleep_for(std::chrono::milliseconds(delay)); } }, delay); @@ -897,7 +898,7 @@ bool ConsolePlayer::open (void) void ConsolePlayer::close () { - m_engine.stop(); + stop(); if (m_state == playerExit) { // Natural finish emuflush (); diff --git a/src/player.h b/src/player.h index 3532c0c..d5416ee 100644 --- a/src/player.h +++ b/src/player.h @@ -148,7 +148,9 @@ class ConsolePlayer sidplayfp m_engine; SidConfig m_engCfg; SidTune m_tune; - player_state_t m_state; + + std::atomic m_state; + const char* m_outfile; std::string m_filename;