Skip to content

Commit

Permalink
lib: Stop applying workaround for libusb < 1.0.9
Browse files Browse the repository at this point in the history
Librtlsdr has a workaround for libusb versions that lack
libusb_handle_events_timeout_completed, which was added in version 1.0.9
(released 2012-04-02). The workaround is always applied unless the
HAVE_LIBUSB_HANDLE_EVENTS_TIMEOUT_COMPLETED macro is set, but the cmake
code that sets this macro was removed in
849f8ef. As a result, the workaround is
now always applied. This results in an extra 1-second delay whenever a
GNU Radio flowgraph containing an RTL-SDR block is stopped, which makes
operations like switching between demodulators in Gqrx annoyingly slow.

To solve this problem, I've simply removed the workaround, as it should
no longer be needed.

I wonder if perhaps the workaround recently applied in
2659e2d might stem from the same bug.
  • Loading branch information
argilo authored and steve-m committed Jan 19, 2022
1 parent 2659e2d commit 5e73f90
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions src/librtlsdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,6 @@
#define LIBUSB_CALL
#endif

/* libusb < 1.0.9 doesn't have libusb_handle_events_timeout_completed */
#ifndef HAVE_LIBUSB_HANDLE_EVENTS_TIMEOUT_COMPLETED
#define libusb_handle_events_timeout_completed(ctx, tv, c) \
libusb_handle_events_timeout(ctx, tv)
#endif

/* two raised to the power of n */
#define TWO_POW(n) ((double)(1ULL<<(n)))

Expand Down

0 comments on commit 5e73f90

Please sign in to comment.