Ignore bogus refresh rates just to be on the safe side

This commit is contained in:
Cameron Gutman 2018-02-04 15:26:40 -08:00
parent d4ff58b3ad
commit 3bcd2ee068
2 changed files with 5 additions and 1 deletions

View File

@ -12,7 +12,7 @@ android {
targetSdkVersion 27 targetSdkVersion 27
versionName "5.6.5" versionName "5.6.5"
versionCode = 144 versionCode = 145
} }
flavorDimensions "root" flavorDimensions "root"

View File

@ -329,6 +329,10 @@ public class Game extends Activity implements SurfaceHolder.Callback,
// Hopefully, we can get rid of this once someone comes up with a better way // Hopefully, we can get rid of this once someone comes up with a better way
// to track the state of the pipeline and time frames. // to track the state of the pipeline and time frames.
int roundedRefreshRate = Math.round(displayRefreshRate); int roundedRefreshRate = Math.round(displayRefreshRate);
if (roundedRefreshRate <= 49) {
// Let's avoid clearly bogus refresh rates
roundedRefreshRate = 60;
}
if (!prefConfig.disableFrameDrop && prefConfig.fps >= roundedRefreshRate) { if (!prefConfig.disableFrameDrop && prefConfig.fps >= roundedRefreshRate) {
prefConfig.fps = roundedRefreshRate - 1; prefConfig.fps = roundedRefreshRate - 1;
LimeLog.info("Adjusting FPS target for screen to "+prefConfig.fps); LimeLog.info("Adjusting FPS target for screen to "+prefConfig.fps);