Ignore sensor delta values that look like they're out of range
This commit is contained in:
@@ -589,8 +589,11 @@ 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);
|
||||||
}
|
}
|
||||||
|
// Sanity check the delta value
|
||||||
|
if (delta < 100000) {
|
||||||
ctx->sensor_timestamp_interval = SDL_US_TO_NS(delta);
|
ctx->sensor_timestamp_interval = SDL_US_TO_NS(delta);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
ctx->last_tick = tick;
|
ctx->last_tick = tick;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user