From c893ccca58cb504b003b100880cc5074faf9e822 Mon Sep 17 00:00:00 2001 From: nyanpasu64 Date: Sun, 2 Jul 2023 22:24:08 -0700 Subject: [PATCH] Workaround GC adapter detection breaking when reset fails --- Source/Core/InputCommon/GCAdapter.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Source/Core/InputCommon/GCAdapter.cpp b/Source/Core/InputCommon/GCAdapter.cpp index 6088256a55..bb1542988e 100644 --- a/Source/Core/InputCommon/GCAdapter.cpp +++ b/Source/Core/InputCommon/GCAdapter.cpp @@ -218,10 +218,9 @@ static void ReadThreadFunc() error = libusb_reset_device(s_handle); ERROR_LOG_FMT(CONTROLLERINTERFACE, "Read: libusb_reset_device: {}", LibusbUtils::ErrorWrap(error)); - if (error != 0) - { - break; - } + + // If error is nonzero, try fixing it next loop iteration. We can't easily return + // and cleanup program state without getting another thread to call Reset(). } ProcessInputPayload(input_buffer.data(), payload_size);