mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2024-11-26 21:58:37 -05:00
fix waterfall lock-up
This commit is contained in:
parent
730d123e23
commit
748bb39795
@ -26,7 +26,7 @@ void FFTDataDistributor::process() {
|
||||
if (inp) {
|
||||
if (inputBuffer.sampleRate != inp->sampleRate || inputBuffer.frequency != inp->frequency) {
|
||||
|
||||
bufferMax = inp->sampleRate / 4;
|
||||
bufferMax = inp->sampleRate / 2;
|
||||
// std::cout << "Buffer Max: " << bufferMax << std::endl;
|
||||
bufferOffset = 0;
|
||||
|
||||
@ -37,6 +37,8 @@ void FFTDataDistributor::process() {
|
||||
if ((bufferOffset + bufferedItems + inp->data.size()) > bufferMax) {
|
||||
std::cout << "Buffer max failed: " << bufferMax << ", ofs: " << bufferOffset
|
||||
<< ", input size: " << inp->data.size() << ", items: " << bufferedItems << std::endl;
|
||||
memmove(&inputBuffer.data[0], &inputBuffer.data[bufferOffset], bufferedItems*sizeof(liquid_float_complex));
|
||||
bufferOffset = 0;
|
||||
} else {
|
||||
memcpy(&inputBuffer.data[bufferOffset+bufferedItems],&inp->data[0],inp->data.size()*sizeof(liquid_float_complex));
|
||||
bufferedItems += inp->data.size();
|
||||
|
Loading…
Reference in New Issue
Block a user