diff --git a/src/platform/qt/GameController.cpp b/src/platform/qt/GameController.cpp index c3d54bd51..79e37ae0c 100644 --- a/src/platform/qt/GameController.cpp +++ b/src/platform/qt/GameController.cpp @@ -308,6 +308,8 @@ void GameController::setConfig(const mCoreConfig* config) { if (isLoaded()) { threadInterrupt(); mCoreLoadForeignConfig(m_threadContext.core, config); + m_audioSync = m_threadContext.sync.audioWait; + m_videoSync = m_threadContext.sync.videoFrameWait; m_audioProcessor->setInput(&m_threadContext); threadContinue(); } @@ -1040,6 +1042,17 @@ void GameController::setSync(bool enable) { } m_sync = enable; } + +void GameController::setAudioSync(bool enable) { + m_audioSync = enable; + m_threadContext.sync.audioWait = enable; +} + +void GameController::setVideoSync(bool enable) { + m_videoSync = enable; + m_threadContext.sync.videoFrameWait = enable; +} + void GameController::setAVStream(mAVStream* stream) { threadInterrupt(); m_stream = stream; diff --git a/src/platform/qt/GameController.h b/src/platform/qt/GameController.h index 721e2809d..dcd54d841 100644 --- a/src/platform/qt/GameController.h +++ b/src/platform/qt/GameController.h @@ -139,6 +139,8 @@ public slots: void setTurbo(bool, bool forced = true); void setTurboSpeed(float ratio); void setSync(bool); + void setAudioSync(bool); + void setVideoSync(bool); void setAVStream(mAVStream*); void clearAVStream(); void reloadAudioDriver(); diff --git a/src/platform/qt/Window.cpp b/src/platform/qt/Window.cpp index a3d99cac9..e0cdcb02f 100644 --- a/src/platform/qt/Window.cpp +++ b/src/platform/qt/Window.cpp @@ -1147,14 +1147,14 @@ void Window::setupMenu(QMenuBar* menubar) { ConfigOption* videoSync = m_config->addOption("videoSync"); videoSync->addBoolean(tr("Sync to &video"), emulationMenu); videoSync->connect([this](const QVariant& value) { - reloadConfig(); + m_controller->setVideoSync(value.toBool()); }, this); m_config->updateOption("videoSync"); ConfigOption* audioSync = m_config->addOption("audioSync"); audioSync->addBoolean(tr("Sync to &audio"), emulationMenu); audioSync->connect([this](const QVariant& value) { - reloadConfig(); + m_controller->setAudioSync(value.toBool()); }, this); m_config->updateOption("audioSync");