moonlight-stream / moonlight-android

GameStream client for Android
GNU General Public License v3.0
3.17k stars 503 forks source link

Latency message after streaming now reports with decimal point #1313

Closed kentyman23 closed 4 months ago

kentyman23 commented 4 months ago

The Show latency message after streaming toast previously reported truncated integers because integer division was used to calculate them (5.99 would be reported as 5). This led to inaccuracies reported here: https://docs.google.com/spreadsheets/d/1WSyOIq9Mn7uTd94PC_LXcFlUi9ceZHhRgk-Yld9rLKc/

Since we're using floating-point arithmetic, we no longer have to avoid divide-by-zero errors. Corner cases one might see are "∞ ms" (positive time divided by 0 frames) or "NaN ms" (0 time divided by 0 frames). I felt these were perfectly fine to output in these theoretical, degenerate cases. Because of this, I was able to simplify the logic in Game.onStop to no longer check for 0s and even remove the conn_hardware_latency localized string.

kentyman23 commented 4 months ago

This PR was closed after I realized I pushed to my fork's master instead of a branch. See #1314 instead.