mirror of
https://github.com/Genymobile/scrcpy.git
synced 2026-07-01 01:36:19 +08:00
Log gamepad error
Call `SDL_GetError()` to know why opening a gamepad failed. Refs #6843 <https://github.com/Genymobile/scrcpy/issues/6843> PR #6853 <https://github.com/Genymobile/scrcpy/pull/6853>
This commit is contained in:
@@ -1048,13 +1048,13 @@ sc_input_manager_process_gamepad_device(struct sc_input_manager *im,
|
||||
if (event->type == SDL_EVENT_GAMEPAD_ADDED) {
|
||||
SDL_Gamepad *sdl_gamepad = SDL_OpenGamepad(event->which);
|
||||
if (!sdl_gamepad) {
|
||||
LOGW("Could not open gamepad");
|
||||
LOGW("Could not open gamepad: %s", SDL_GetError());
|
||||
return;
|
||||
}
|
||||
|
||||
SDL_Joystick *joystick = SDL_GetGamepadJoystick(sdl_gamepad);
|
||||
if (!joystick) {
|
||||
LOGW("Could not get gamepad joystick");
|
||||
LOGW("Could not get gamepad joystick: %s", SDL_GetError());
|
||||
SDL_CloseGamepad(sdl_gamepad);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user