mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-05-30 05:18:13 +08:00
Ignore sensor delta values that look like they're out of range
This commit is contained in:
@@ -589,7 +589,10 @@ static void HIDAPI_Driver8BitDo_HandleStatePacket(SDL_Joystick *joystick, SDL_Dr
|
|||||||
} else {
|
} else {
|
||||||
delta = (SDL_MAX_UINT32 - ctx->last_tick + tick + 1);
|
delta = (SDL_MAX_UINT32 - ctx->last_tick + tick + 1);
|
||||||
}
|
}
|
||||||
ctx->sensor_timestamp_interval = SDL_US_TO_NS(delta);
|
// Sanity check the delta value
|
||||||
|
if (delta < 100000) {
|
||||||
|
ctx->sensor_timestamp_interval = SDL_US_TO_NS(delta);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
ctx->last_tick = tick;
|
ctx->last_tick = tick;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user