switched all streams to double buffering

This commit is contained in:
Ryzerth
2020-12-25 16:58:07 +01:00
parent 450896b122
commit 42bc2d01f7
17 changed files with 158 additions and 171 deletions

View File

@ -229,12 +229,11 @@ private:
int16_t* buf = (int16_t*)iio_buffer_first(rxbuf, rx0_i);
if (_this->stream.aquire() < 0) { break; }
for (int i = 0; i < blockSize; i++) {
_this->stream.data[i].q = (float)buf[i * 2] / 32768.0f;
_this->stream.data[i].i = (float)buf[(i * 2) + 1] / 32768.0f;
_this->stream.writeBuf[i].q = (float)buf[i * 2] / 32768.0f;
_this->stream.writeBuf[i].i = (float)buf[(i * 2) + 1] / 32768.0f;
}
_this->stream.write(blockSize);
if (!_this->stream.swap(blockSize)) { break; };
}
iio_buffer_destroy(rxbuf);