Don't call callback or submit new transfers once streaming stops.

This stops the RX callback from being called again with further data
once it has returned nonzero, or after a transfer had an error status.
This commit is contained in:
Martin Ling
2022-03-18 00:56:25 +00:00
parent 6720e56fc0
commit 125bf9f7bb

View File

@ -1737,7 +1737,7 @@ static void LIBUSB_CALL hackrf_libusb_transfer_callback(struct libusb_transfer*
.tx_ctx = device->tx_ctx
};
if( device->callback(&transfer) == 0 )
if (device->streaming && device->callback(&transfer) == 0)
{
// Take lock to make sure that we don't restart a
// transfer whilst cancel_transfers() is in the middle