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:
@ -1737,7 +1737,7 @@ static void LIBUSB_CALL hackrf_libusb_transfer_callback(struct libusb_transfer*
|
|||||||
.tx_ctx = device->tx_ctx
|
.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
|
// Take lock to make sure that we don't restart a
|
||||||
// transfer whilst cancel_transfers() is in the middle
|
// transfer whilst cancel_transfers() is in the middle
|
||||||
|
Reference in New Issue
Block a user