mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2026-08-14 23:43:29 -04:00
Static analysis related fixes
This commit is contained in:
@@ -137,17 +137,23 @@ bool DemodulatorInstance::isTerminated() {
|
||||
|
||||
switch (cmd.cmd) {
|
||||
case DemodulatorThreadCommand::DEMOD_THREAD_CMD_AUDIO_TERMINATED:
|
||||
t_Audio->join();
|
||||
audioTerminated = true;
|
||||
delete t_Audio;
|
||||
if (t_Audio) {
|
||||
t_Audio->join();
|
||||
audioTerminated = true;
|
||||
delete t_Audio;
|
||||
t_Audio = nullptr;
|
||||
}
|
||||
break;
|
||||
case DemodulatorThreadCommand::DEMOD_THREAD_CMD_DEMOD_TERMINATED:
|
||||
#ifdef __APPLE__
|
||||
pthread_join(t_Demod, NULL);
|
||||
#else
|
||||
t_Demod->join();
|
||||
delete t_Demod;
|
||||
#endif
|
||||
if (t_Demod) {
|
||||
#ifdef __APPLE__
|
||||
pthread_join(t_Demod, nullptr);
|
||||
#else
|
||||
t_Demod->join();
|
||||
delete t_Demod;
|
||||
#endif
|
||||
t_Demod = nullptr;
|
||||
}
|
||||
#if ENABLE_DIGITAL_LAB
|
||||
if (activeOutput) {
|
||||
closeOutput();
|
||||
@@ -156,13 +162,16 @@ bool DemodulatorInstance::isTerminated() {
|
||||
demodTerminated = true;
|
||||
break;
|
||||
case DemodulatorThreadCommand::DEMOD_THREAD_CMD_DEMOD_PREPROCESS_TERMINATED:
|
||||
#ifdef __APPLE__
|
||||
pthread_join(t_PreDemod, NULL);
|
||||
#else
|
||||
t_PreDemod->join();
|
||||
delete t_PreDemod;
|
||||
#endif
|
||||
preDemodTerminated = true;
|
||||
if (t_PreDemod) {
|
||||
#ifdef __APPLE__
|
||||
pthread_join(t_PreDemod, NULL);
|
||||
#else
|
||||
t_PreDemod->join();
|
||||
delete t_PreDemod;
|
||||
#endif
|
||||
preDemodTerminated = true;
|
||||
t_PreDemod = nullptr;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -84,7 +84,7 @@ void DemodulatorWorkerThread::run() {
|
||||
|
||||
float As = 60.0f; // stop-band attenuation [dB]
|
||||
|
||||
if (result.sampleRate && result.bandwidth) {
|
||||
if (cModem && result.sampleRate && result.bandwidth) {
|
||||
result.bandwidth = cModem->checkSampleRate(result.bandwidth, makeDemod?demodCommand.audioSampleRate:filterCommand.audioSampleRate);
|
||||
result.iqResampleRatio = (double) (result.bandwidth) / (double) result.sampleRate;
|
||||
result.iqResampler = msresamp_crcf_create(result.iqResampleRatio, As);
|
||||
|
||||
Reference in New Issue
Block a user