Use the original manufacturer and product strings for the joystick CRC

This allows the most information possible for the CRC string, which is used to differentiate controllers with the same VID/PID.

Fixes https://github.com/libsdl-org/SDL/issues/8724

(cherry picked from commit 1f1ee6f77c)
This commit is contained in:
Sam Lantinga
2023-12-20 19:05:20 -08:00
parent d76097dc5e
commit 919cd56b20
14 changed files with 37 additions and 32 deletions

View File

@@ -319,7 +319,7 @@ static int IsJoystick(const char *path, int fd, char **name_return, Uint16 *vend
SDL_Log("Joystick: %s, bustype = %d, vendor = 0x%.4x, product = 0x%.4x, version = %d\n", name, inpid.bustype, inpid.vendor, inpid.product, inpid.version);
#endif
*guid = SDL_CreateJoystickGUID(inpid.bustype, inpid.vendor, inpid.product, inpid.version, name, 0, 0);
*guid = SDL_CreateJoystickGUID(inpid.bustype, inpid.vendor, inpid.product, inpid.version, NULL, product_string, 0, 0);
if (SDL_ShouldIgnoreJoystick(name, *guid)) {
SDL_free(name);