Prevent flooding the queue with motion events
This commit is contained in:
parent
47fa51034a
commit
8d30079033
1 changed files with 7 additions and 0 deletions
|
|
@ -1444,6 +1444,13 @@ int LiSendControllerMotionEvent(uint8_t controllerNumber, uint8_t motionType, fl
|
||||||
return LI_ERR_UNSUPPORTED;
|
return LI_ERR_UNSUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Since these events can be sent incredibly frequently, let's avoid queuing more if
|
||||||
|
// we already have more than half of our max input queue full of other events.
|
||||||
|
if (LbqGetItemCount(&packetQueue) > MAX_QUEUED_INPUT_PACKETS / 2) {
|
||||||
|
Limelog("Dropping motion event due to high input queue length\n");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
// Sunshine supports up to 16 controllers
|
// Sunshine supports up to 16 controllers
|
||||||
controllerNumber %= MAX_GAMEPADS;
|
controllerNumber %= MAX_GAMEPADS;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue