File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff 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
898899void ConsolePlayer::close ()
899900{
900- m_engine. stop ();
901+ stop ();
901902 if (m_state == playerExit)
902903 { // Natural finish
903904 emuflush ();
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments