mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2026-06-17 14:21:30 +00:00
Tune thresholds for poor connection warning
This commit is contained in:
+3
-2
@@ -45,8 +45,9 @@ static int lastConnectionStatusUpdate;
|
|||||||
static int idrFrameRequired;
|
static int idrFrameRequired;
|
||||||
static LINKED_BLOCKING_QUEUE invalidReferenceFrameTuples;
|
static LINKED_BLOCKING_QUEUE invalidReferenceFrameTuples;
|
||||||
|
|
||||||
#define CONN_POOR_LOSS_RATE 40
|
#define CONN_POOR_LOSS_RATE 15
|
||||||
#define CONN_OKAY_LOSS_RATE 5
|
#define CONN_OKAY_LOSS_RATE 5
|
||||||
|
#define CONN_STATUS_SAMPLE_PERIOD 3000
|
||||||
|
|
||||||
#define IDX_START_A 0
|
#define IDX_START_A 0
|
||||||
#define IDX_REQUEST_IDR_FRAME 0
|
#define IDX_REQUEST_IDR_FRAME 0
|
||||||
@@ -274,7 +275,7 @@ void connectionReceivedCompleteFrame(int frameIndex) {
|
|||||||
|
|
||||||
void connectionSawFrame(int frameIndex) {
|
void connectionSawFrame(int frameIndex) {
|
||||||
uint64_t now = PltGetMillis();
|
uint64_t now = PltGetMillis();
|
||||||
if (now - intervalStartTimeMs >= 1000) {
|
if (now - intervalStartTimeMs >= CONN_STATUS_SAMPLE_PERIOD) {
|
||||||
if (intervalTotalFrameCount != 0) {
|
if (intervalTotalFrameCount != 0) {
|
||||||
// Notify the client of connection status changes based on frame loss rate
|
// Notify the client of connection status changes based on frame loss rate
|
||||||
int frameLossPercent = 100 - (intervalGoodFrameCount * 100) / intervalTotalFrameCount;
|
int frameLossPercent = 100 - (intervalGoodFrameCount * 100) / intervalTotalFrameCount;
|
||||||
|
|||||||
Reference in New Issue
Block a user