Clear streaming flag if we didn't resubmit a transfer.

If result < 0 here, libusb_submit_transfer returned an error, so we
need to shut down.

If !resubmit, then cancel_transfers() was already called by one of the
stop or close functions, so streaming is already false.
This commit is contained in:
Martin Ling
2022-03-18 01:02:33 +00:00
parent 9e1cb5c003
commit 6720e56fc0

View File

@ -1754,6 +1754,7 @@ static void LIBUSB_CALL hackrf_libusb_transfer_callback(struct libusb_transfer*
if (!resubmit || result < 0) { if (!resubmit || result < 0) {
transfer_finished(device, usb_transfer); transfer_finished(device, usb_transfer);
device->streaming = false;
} }
} else { } else {
transfer_finished(device, usb_transfer); transfer_finished(device, usb_transfer);