]> git.sesse.net Git - bmusb/commitdiff
Set libusb timeout to one second, to help shutdown if the thread is started with...
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Wed, 27 Jul 2016 19:46:37 +0000 (21:46 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Wed, 27 Jul 2016 19:47:01 +0000 (21:47 +0200)
bmusb.cpp

index e9a912524b25a25e809e2f8b35c275b3f1227236..cd4e59c4302b5d6cdba09080cd4b36c7337e7c2a 100644 (file)
--- a/bmusb.cpp
+++ b/bmusb.cpp
@@ -878,7 +878,8 @@ void BMUSBCapture::usb_thread_func()
                printf("couldn't set realtime priority for USB thread: %s\n", strerror(errno));
        }
        while (!should_quit) {
-               int rc = libusb_handle_events(nullptr);
+               timeval sec { 1, 0 };
+               int rc = libusb_handle_events_timeout(nullptr, &sec);
                if (rc != LIBUSB_SUCCESS)
                        break;
        }