From 14ccc38f4c420573faa7d49400b8295388f7b71a Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 30 Aug 2020 01:38:26 -0700 Subject: [PATCH] Fix certain CLI options not overriding GUI preferences. Fixes #435 --- app/streaming/session.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/app/streaming/session.cpp b/app/streaming/session.cpp index e7360ca5..3457a207 100644 --- a/app/streaming/session.cpp +++ b/app/streaming/session.cpp @@ -941,8 +941,6 @@ private: // Called in a non-main thread bool Session::startConnectionAsync() { - StreamingPreferences prefs; - // Wait 1.5 seconds before connecting to let the user // have time to read any messages present on the segue SDL_Delay(1500); @@ -962,7 +960,7 @@ bool Session::startConnectionAsync() SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, "Found host supported resolution: %dx%d", mode.width, mode.height); - enableGameOptimizations = prefs.gameOptimizations; + enableGameOptimizations = m_Preferences->gameOptimizations; break; } } @@ -975,7 +973,7 @@ bool Session::startConnectionAsync() else { http.launchApp(m_App.id, &m_StreamConfig, enableGameOptimizations, - prefs.playAudioOnHost, + m_Preferences->playAudioOnHost, m_InputHandler->getAttachedGamepadMask()); } } catch (const GfeHttpResponseException& e) { @@ -1064,8 +1062,7 @@ void Session::exec(int displayOriginX, int displayOriginY) // Initialize the gamepad code with our preferences // NB: m_InputHandler must be initialize before starting the connection. - StreamingPreferences prefs; - m_InputHandler = new SdlInputHandler(prefs, m_Computer, + m_InputHandler = new SdlInputHandler(*m_Preferences, m_Computer, m_StreamConfig.width, m_StreamConfig.height); @@ -1200,7 +1197,7 @@ void Session::exec(int displayOriginX, int displayOriginY) m_UnexpectedTermination = false; // Start rich presence to indicate we're in game - RichPresenceManager presence(prefs, m_App.name); + RichPresenceManager presence(*m_Preferences, m_App.name); // Hijack this thread to be the SDL main thread. We have to do this // because we want to suspend all Qt processing until the stream is over.