mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2026-06-13 19:29:08 -04:00
Possible null pointer calls, fix unnecessary context switches
This commit is contained in:
@@ -255,7 +255,9 @@ void DemodulatorInstance::setOutputDevice(int device_id) {
|
||||
|
||||
int DemodulatorInstance::getOutputDevice() {
|
||||
if (currentOutputDevice == -1) {
|
||||
currentOutputDevice = audioThread->getOutputDevice();
|
||||
if (audioThread) {
|
||||
currentOutputDevice = audioThread->getOutputDevice();
|
||||
}
|
||||
}
|
||||
|
||||
return currentOutputDevice;
|
||||
@@ -308,7 +310,7 @@ void DemodulatorInstance::setBandwidth(int bw) {
|
||||
bw = AudioThread::deviceSampleRate[getOutputDevice()];
|
||||
}
|
||||
}
|
||||
if (!active) {
|
||||
if (!active && demodulatorPreThread != NULL) {
|
||||
currentBandwidth = bw;
|
||||
checkBandwidth();
|
||||
demodulatorPreThread->getParams().bandwidth = currentBandwidth;
|
||||
|
||||
Reference in New Issue
Block a user