mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-06-17 14:11:33 +00:00
Fix SOPS issues causing 720p60 settings on non-standard resolutions and FPS values
This commit is contained in:
@@ -172,7 +172,10 @@ NvHTTP::launchApp(int appId,
|
|||||||
"appid="+QString::number(appId)+
|
"appid="+QString::number(appId)+
|
||||||
"&mode="+QString::number(streamConfig->width)+"x"+
|
"&mode="+QString::number(streamConfig->width)+"x"+
|
||||||
QString::number(streamConfig->height)+"x"+
|
QString::number(streamConfig->height)+"x"+
|
||||||
QString::number(streamConfig->fps)+
|
// Using an FPS value over 60 causes SOPS to default to 720p60,
|
||||||
|
// so force it to 60 when starting. This won't impact our ability
|
||||||
|
// to get > 60 FPS while actually streaming though.
|
||||||
|
QString::number(streamConfig->fps > 60 ? 60 : streamConfig->fps)+
|
||||||
"&additionalStates=1&sops="+QString::number(sops ? 1 : 0)+
|
"&additionalStates=1&sops="+QString::number(sops ? 1 : 0)+
|
||||||
"&rikey="+QByteArray(streamConfig->remoteInputAesKey, sizeof(streamConfig->remoteInputAesKey)).toHex()+
|
"&rikey="+QByteArray(streamConfig->remoteInputAesKey, sizeof(streamConfig->remoteInputAesKey)).toHex()+
|
||||||
"&rikeyid="+QString::number(riKeyId)+
|
"&rikeyid="+QString::number(riKeyId)+
|
||||||
|
|||||||
@@ -815,6 +815,21 @@ void Session::exec(int displayOriginX, int displayOriginY)
|
|||||||
Q_ASSERT(m_Computer->currentGameId == 0 ||
|
Q_ASSERT(m_Computer->currentGameId == 0 ||
|
||||||
m_Computer->currentGameId == m_App.id);
|
m_Computer->currentGameId == m_App.id);
|
||||||
|
|
||||||
|
// SOPS will set all settings to 720p60 if it doesn't recognize
|
||||||
|
// the chosen resolution. Avoid that by disabling SOPS when it
|
||||||
|
// is not streaming a supported resolution.
|
||||||
|
bool enableGameOptimizations = false;
|
||||||
|
for (const NvDisplayMode &mode : m_Computer->displayModes) {
|
||||||
|
if (mode.width == m_StreamConfig.width &&
|
||||||
|
mode.height == m_StreamConfig.height) {
|
||||||
|
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,
|
||||||
|
"Found host supported resolution: %dx%d",
|
||||||
|
mode.width, mode.height);
|
||||||
|
enableGameOptimizations = prefs.gameOptimizations;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
NvHTTP http(m_Computer->activeAddress, m_Computer->serverCert);
|
NvHTTP http(m_Computer->activeAddress, m_Computer->serverCert);
|
||||||
if (m_Computer->currentGameId != 0) {
|
if (m_Computer->currentGameId != 0) {
|
||||||
@@ -822,7 +837,7 @@ void Session::exec(int displayOriginX, int displayOriginY)
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
http.launchApp(m_App.id, &m_StreamConfig,
|
http.launchApp(m_App.id, &m_StreamConfig,
|
||||||
prefs.gameOptimizations,
|
enableGameOptimizations,
|
||||||
prefs.playAudioOnHost,
|
prefs.playAudioOnHost,
|
||||||
inputHandler.getAttachedGamepadMask());
|
inputHandler.getAttachedGamepadMask());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user