mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2025-02-03 13:24:46 +01:00
Final fix for the linux crash
This commit is contained in:
parent
8a4055920d
commit
bd744d07ba
@ -135,11 +135,14 @@ void SignalPath::setBuffering(bool enabled) {
|
|||||||
|
|
||||||
void SignalPath::setDecimation(int dec) {
|
void SignalPath::setDecimation(int dec) {
|
||||||
decimation = dec;
|
decimation = dec;
|
||||||
|
if (running) { split.stop(); }
|
||||||
|
|
||||||
// Stop existing decimators
|
// Stop existing decimators
|
||||||
if (!decimators.empty()) {
|
if (!decimators.empty()) {
|
||||||
for (auto& decimator : decimators) {
|
for (auto& decimator : decimators) {
|
||||||
decimator->stop();
|
decimator->stop();
|
||||||
|
}
|
||||||
|
for (auto& decimator : decimators) {
|
||||||
delete decimator;
|
delete decimator;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -148,12 +151,12 @@ void SignalPath::setDecimation(int dec) {
|
|||||||
// If no decimation, reconnect
|
// If no decimation, reconnect
|
||||||
if (!dec) {
|
if (!dec) {
|
||||||
split.setInput(&inputBuffer.out);
|
split.setInput(&inputBuffer.out);
|
||||||
|
if (running) { split.start(); }
|
||||||
core::setInputSampleRate(sourceSampleRate);
|
core::setInputSampleRate(sourceSampleRate);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create new decimators
|
// Create new decimators
|
||||||
if (running) { split.stop(); }
|
|
||||||
for (int i = 0; i < dec; i++) {
|
for (int i = 0; i < dec; i++) {
|
||||||
dsp::HalfDecimator<dsp::complex_t>* decimator = new dsp::HalfDecimator<dsp::complex_t>((i == 0) ? &inputBuffer.out : &decimators[i-1]->out, &halfBandWindow);
|
dsp::HalfDecimator<dsp::complex_t>* decimator = new dsp::HalfDecimator<dsp::complex_t>((i == 0) ? &inputBuffer.out : &decimators[i-1]->out, &halfBandWindow);
|
||||||
if (running) { decimator->start(); }
|
if (running) { decimator->start(); }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user