/* Get the player index of a joystick, or -1 if it's not available  */
int SDL_JoystickGetDevicePlayerIndex(int device_index)
/* Get the player index of a joystick, or -1 if it's not available  */
int SDL_JoystickGetDevicePlayerIndex(int device_index)
{
    int player_index;
    SDL_LockJoysticks();
    player_index = SDL_GetPlayerIndexForJoystickID(SDL_JoystickGetDeviceInstanceID(device_index));
    SDL_UnlockJoysticks();
    return player_index;
}