From ad36ede26ba4c009b11198a364eba457d4d42d21 Mon Sep 17 00:00:00 2001 From: AlexandreRouma Date: Sat, 27 Aug 2022 00:03:46 +0200 Subject: [PATCH] hackrf code cleanup --- source_modules/hackrf_source/src/main.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/source_modules/hackrf_source/src/main.cpp b/source_modules/hackrf_source/src/main.cpp index 28f379ab..c236152d 100644 --- a/source_modules/hackrf_source/src/main.cpp +++ b/source_modules/hackrf_source/src/main.cpp @@ -379,10 +379,8 @@ private: static int callback(hackrf_transfer* transfer) { HackRFSourceModule* _this = (HackRFSourceModule*)transfer->rx_ctx; - int count = transfer->valid_length / 2; - int8_t* buffer = (int8_t*)transfer->buffer; - volk_8i_s32f_convert_32f((float*)_this->stream.writeBuf, buffer, 128.0f, count * 2); - if (!_this->stream.swap(count)) { return -1; } + volk_8i_s32f_convert_32f((float*)_this->stream.writeBuf, (int8_t*)transfer->buffer, 128.0f, transfer->valid_length); + if (!_this->stream.swap(transfer->valid_length / 2)) { return -1; } return 0; }