mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-06-07 16:17:20 +02:00
Don't show negative packetLost
This commit is contained in:
parent
9a2e7de68d
commit
ea9ad16770
@ -142,10 +142,10 @@ export class StreamStats {
|
|||||||
this.#$fps!.textContent = stat.framesPerSecond || 0;
|
this.#$fps!.textContent = stat.framesPerSecond || 0;
|
||||||
|
|
||||||
// Packets Lost
|
// Packets Lost
|
||||||
const packetsLost = stat.packetsLost;
|
const packetsLost = Math.max(0, stat.packetsLost); // packetsLost can be negative, but we don't care about that
|
||||||
const packetsReceived = stat.packetsReceived;
|
const packetsReceived = stat.packetsReceived;
|
||||||
const packetsLostPercentage = (packetsLost * 100 / ((packetsLost + packetsReceived) || 1)).toFixed(2);
|
const packetsLostPercentage = (packetsLost * 100 / ((packetsLost + packetsReceived) || 1)).toFixed(2);
|
||||||
this.#$pl!.textContent = packetsLostPercentage === '0.00' ? packetsLost : `${packetsLost} (${packetsLostPercentage}%)`;
|
this.#$pl!.textContent = packetsLostPercentage === '0.00' ? packetsLost.toString() : `${packetsLost} (${packetsLostPercentage}%)`;
|
||||||
|
|
||||||
// Frames dropped
|
// Frames dropped
|
||||||
const framesDropped = stat.framesDropped;
|
const framesDropped = stat.framesDropped;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user