mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-18 18:42:46 +00:00
Use the original FPS value for KEY_FRAME_RATE
This commit is contained in:
parent
68a6b510b1
commit
dcb7be3acd
@ -399,6 +399,7 @@ 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);
|
||||||
|
int chosenFrameRate = prefConfig.fps;
|
||||||
if (!prefConfig.disableFrameDrop || prefConfig.unlockFps) {
|
if (!prefConfig.disableFrameDrop || prefConfig.unlockFps) {
|
||||||
if (Build.DEVICE.equals("coral") || Build.DEVICE.equals("flame")) {
|
if (Build.DEVICE.equals("coral") || Build.DEVICE.equals("flame")) {
|
||||||
// HACK: Pixel 4 (XL) ignores the preferred display mode and lowers refresh rate,
|
// HACK: Pixel 4 (XL) ignores the preferred display mode and lowers refresh rate,
|
||||||
@ -424,8 +425,8 @@ public class Game extends Activity implements SurfaceHolder.Callback,
|
|||||||
// Use the old rendering strategy on these broken devices
|
// Use the old rendering strategy on these broken devices
|
||||||
decoderRenderer.enableLegacyFrameDropRendering();
|
decoderRenderer.enableLegacyFrameDropRendering();
|
||||||
} else {
|
} else {
|
||||||
prefConfig.fps = roundedRefreshRate - 1;
|
chosenFrameRate = roundedRefreshRate - 1;
|
||||||
LimeLog.info("Adjusting FPS target for screen to " + prefConfig.fps);
|
LimeLog.info("Adjusting FPS target for screen to " + chosenFrameRate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -437,7 +438,7 @@ public class Game extends Activity implements SurfaceHolder.Callback,
|
|||||||
|
|
||||||
StreamConfiguration config = new StreamConfiguration.Builder()
|
StreamConfiguration config = new StreamConfiguration.Builder()
|
||||||
.setResolution(prefConfig.width, prefConfig.height)
|
.setResolution(prefConfig.width, prefConfig.height)
|
||||||
.setRefreshRate(prefConfig.fps)
|
.setRefreshRate(chosenFrameRate)
|
||||||
.setApp(new NvApp(appName != null ? appName : "app", appId, willStreamHdr))
|
.setApp(new NvApp(appName != null ? appName : "app", appId, willStreamHdr))
|
||||||
.setBitrate(prefConfig.bitrate)
|
.setBitrate(prefConfig.bitrate)
|
||||||
.setEnableSops(prefConfig.enableSops)
|
.setEnableSops(prefConfig.enableSops)
|
||||||
|
@ -303,7 +303,10 @@ public class MediaCodecDecoderRenderer extends VideoDecoderRenderer {
|
|||||||
|
|
||||||
MediaFormat videoFormat = MediaFormat.createVideoFormat(mimeType, width, height);
|
MediaFormat videoFormat = MediaFormat.createVideoFormat(mimeType, width, height);
|
||||||
|
|
||||||
videoFormat.setInteger(MediaFormat.KEY_FRAME_RATE, redrawRate);
|
// We use prefs.fps instead of redrawRate here because the low latency hack in Game.java
|
||||||
|
// may leave us with an odd redrawRate value like 59 or 49 which might cause the decoder
|
||||||
|
// to puke. To be safe, we'll use the unmodified value.
|
||||||
|
videoFormat.setInteger(MediaFormat.KEY_FRAME_RATE, prefs.fps);
|
||||||
|
|
||||||
// Adaptive playback can also be enabled by the whitelist on pre-KitKat devices
|
// Adaptive playback can also be enabled by the whitelist on pre-KitKat devices
|
||||||
// so we don't fill these pre-KitKat
|
// so we don't fill these pre-KitKat
|
||||||
|
Loading…
x
Reference in New Issue
Block a user