Fix main loop exiting immediately after USB timeout
The loop condition `while (err >= 0)` was failing after a timeout because LIBUSB_ERROR_TIMEOUT is -7. Even with `continue`, the loop condition was still checked and the loop exited. Fix: Reset err to 0 before continuing after a timeout. https://claude.ai/code/session_01H5sr8TkRyt6U1vdkVZRRvy
+1 · 1 file changed
-
src/device.c+1 −0
@@ -390,6 +390,7 @@ void device_run(libusb_context* ctx, config_t* config, int debug, int accept, in if (err == LIBUSB_ERROR_TIMEOUT) { // Normal timeout - just continue to process OSD events + err = 0; // Reset err so loop continues continue; } if (err == LIBUSB_ERROR_PIPE)