From dbb3087078e477237f20409b576bd2ac15c79c1d Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Thu, 2 Feb 2023 23:13:09 -0600 Subject: [PATCH] Don't suppress high refresh rates with Sunshine --- Limelight/Network/HttpManager.m | 5 +++-- Limelight/Stream/StreamManager.m | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Limelight/Network/HttpManager.m b/Limelight/Network/HttpManager.m index 6870f8d..e73a97a 100644 --- a/Limelight/Network/HttpManager.m +++ b/Limelight/Network/HttpManager.m @@ -272,8 +272,9 @@ // Using an FPS value over 60 causes SOPS to default to 720p60, // so force it to 0 to ensure the correct resolution is set. We // used to use 60 here but that locked the frame rate to 60 FPS - // on GFE 3.20.3. - int fps = config.frameRate > 60 ? 0 : config.frameRate; + // on GFE 3.20.3. We do not do this hack for Sunshine (which is + // indicated by a negative version in the last field. + int fps = (config.frameRate > 60 && ![config.appVersion containsString:@".-"]) ? 0 : config.frameRate; NSString* urlString = [NSString stringWithFormat:@"%@/launch?uniqueid=%@&appid=%@&mode=%dx%dx%d&additionalStates=1&sops=%d&rikey=%@&rikeyid=%d%@&localAudioPlayMode=%d&surroundAudioInfo=%d&remoteControllersBitmap=%d&gcmap=%d", _baseHTTPSURL, _uniqueId, diff --git a/Limelight/Stream/StreamManager.m b/Limelight/Stream/StreamManager.m index deeebd2..8e10eea 100644 --- a/Limelight/Stream/StreamManager.m +++ b/Limelight/Stream/StreamManager.m @@ -76,6 +76,10 @@ } } + // Populate the config's version fields from serverinfo + _config.appVersion = appversion; + _config.gfeVersion = gfeVersion; + // resumeApp and launchApp handle calling launchFailed NSString* sessionUrl; if ([serverState hasSuffix:@"_SERVER_BUSY"]) { @@ -93,10 +97,6 @@ // Populate RTSP session URL from launch/resume response _config.rtspSessionUrl = sessionUrl; - // Populate the config's version fields from serverinfo - _config.appVersion = appversion; - _config.gfeVersion = gfeVersion; - // Initializing the renderer must be done on the main thread dispatch_async(dispatch_get_main_queue(), ^{ VideoDecoderRenderer* renderer = [[VideoDecoderRenderer alloc] initWithView:self->_renderView callbacks:self->_callbacks streamAspectRatio:(float)self->_config.width / (float)self->_config.height useFramePacing:self->_config.useFramePacing];