From 65397329585a6d49aafec556d61dcc51c9433265 Mon Sep 17 00:00:00 2001 From: "jvde.github" Date: Sun, 29 May 2022 19:27:58 +0200 Subject: [PATCH 03/46] fix hang issue when device is disconnected --- libairspyhf/src/airspyhf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libairspyhf/src/airspyhf.c b/libairspyhf/src/airspyhf.c index 5a0a457..a830f34 100644 --- a/libairspyhf/src/airspyhf.c +++ b/libairspyhf/src/airspyhf.c @@ -433,12 +433,12 @@ static void airspyhf_libusb_transfer_callback(struct libusb_transfer* usb_transf if (libusb_submit_transfer(usb_transfer) != 0) { - device->streaming = false; + device->stop_requested = true; } } else { - device->streaming = false; + device->stop_requested = true; } } @@ -1170,7 +1170,7 @@ int ADDCALL airspyhf_start(airspyhf_device_t* device, airspyhf_sample_block_cb_f int ADDCALL airspyhf_is_streaming(airspyhf_device_t* device) { - return device->streaming; + return device->streaming && !device->stop_requested; } int ADDCALL airspyhf_stop(airspyhf_device_t* device) -- 2.47.3