Skip to content

Commit c68b777

Browse files
committed
Fix few display issues
1 parent c168479 commit c68b777

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/player.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -885,9 +885,10 @@ bool ConsolePlayer::open (void)
885885
int delay = isNTSC ? 16 : 20;
886886
m_thread = new std::thread([this](int delay)
887887
{
888-
while (m_state == playerRunning)
888+
while (m_state != playerStopped)
889889
{
890-
updateDisplay();
890+
if (m_state == playerRunning)
891+
updateDisplay();
891892
std::this_thread::sleep_for(std::chrono::milliseconds(delay));
892893
}
893894
}, delay);
@@ -897,7 +898,7 @@ bool ConsolePlayer::open (void)
897898

898899
void ConsolePlayer::close ()
899900
{
900-
m_engine.stop();
901+
stop();
901902
if (m_state == playerExit)
902903
{ // Natural finish
903904
emuflush ();

src/player.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,9 @@ class ConsolePlayer
148148
sidplayfp m_engine;
149149
SidConfig m_engCfg;
150150
SidTune m_tune;
151-
player_state_t m_state;
151+
152+
std::atomic<player_state_t> m_state;
153+
152154
const char* m_outfile;
153155
std::string m_filename;
154156

0 commit comments

Comments
 (0)