mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-11 16:49:28 +02:00
Log warnings when LibusbUtils::GetDeviceList fails
This commit is contained in:
@ -11,6 +11,7 @@
|
||||
#endif
|
||||
|
||||
#include "Common/CommonTypes.h"
|
||||
#include "Common/Logging/Log.h"
|
||||
#include "Core/LibusbUtils.h"
|
||||
|
||||
// Because opening and getting the device name from devices is slow, especially on Windows
|
||||
@ -45,13 +46,15 @@ std::map<std::pair<u16, u16>, std::string> GetInsertedDevices()
|
||||
if (!context.IsValid())
|
||||
return devices;
|
||||
|
||||
context.GetDeviceList([&](libusb_device* device) {
|
||||
const int ret = context.GetDeviceList([&](libusb_device* device) {
|
||||
libusb_device_descriptor descr;
|
||||
libusb_get_device_descriptor(device, &descr);
|
||||
const std::pair<u16, u16> vid_pid{descr.idVendor, descr.idProduct};
|
||||
devices[vid_pid] = GetDeviceName(vid_pid);
|
||||
return true;
|
||||
});
|
||||
if (ret != LIBUSB_SUCCESS)
|
||||
WARN_LOG_FMT(COMMON, "GetDeviceList failed: {}", LibusbUtils::ErrorWrap(ret));
|
||||
#endif
|
||||
|
||||
return devices;
|
||||
|
Reference in New Issue
Block a user