mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2024-11-25 13:18:37 -05:00
Make sure squelch lock is released on de-activate too
This commit is contained in:
parent
1fd23b6d33
commit
9f5c674646
@ -214,6 +214,7 @@ void DemodulatorInstance::setActive(bool state) {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
audioThread->setActive(state);
|
audioThread->setActive(state);
|
||||||
|
DemodulatorThread::releaseSquelchLock(this);
|
||||||
} else if (!active && state) {
|
} else if (!active && state) {
|
||||||
#if ENABLE_DIGITAL_LAB
|
#if ENABLE_DIGITAL_LAB
|
||||||
if (activeOutput && getModemType() == "digital") {
|
if (activeOutput && getModemType() == "digital") {
|
||||||
|
@ -26,10 +26,7 @@ DemodulatorThread::DemodulatorThread(DemodulatorInstance *parent)
|
|||||||
}
|
}
|
||||||
|
|
||||||
DemodulatorThread::~DemodulatorThread() {
|
DemodulatorThread::~DemodulatorThread() {
|
||||||
std::lock_guard < std::mutex > lock(squelchLockMutex);
|
releaseSquelchLock(demodInstance);
|
||||||
if (squelchLock.load() == demodInstance) {
|
|
||||||
squelchLock.store(nullptr);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DemodulatorThread::onBindOutput(std::string name, ThreadQueueBase *threadQueue) {
|
void DemodulatorThread::onBindOutput(std::string name, ThreadQueueBase *threadQueue) {
|
||||||
@ -208,10 +205,7 @@ void DemodulatorThread::run() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} else if (squelched && squelchBreak) {
|
} else if (squelched && squelchBreak) {
|
||||||
std::lock_guard < std::mutex > lock(squelchLockMutex);
|
releaseSquelchLock(demodInstance);
|
||||||
if (squelchLock.load() == demodInstance) {
|
|
||||||
squelchLock.store(nullptr);
|
|
||||||
}
|
|
||||||
squelchBreak = false;
|
squelchBreak = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -403,3 +397,14 @@ void DemodulatorThread::setSquelchLevel(float signal_level_in) {
|
|||||||
float DemodulatorThread::getSquelchLevel() {
|
float DemodulatorThread::getSquelchLevel() {
|
||||||
return squelchLevel;
|
return squelchLevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool DemodulatorThread::getSquelchBreak() {
|
||||||
|
return squelchBreak;
|
||||||
|
}
|
||||||
|
|
||||||
|
void DemodulatorThread::releaseSquelchLock(DemodulatorInstance *inst) {
|
||||||
|
std::lock_guard < std::mutex > lock(squelchLockMutex);
|
||||||
|
if (squelchLock.load() == inst) {
|
||||||
|
squelchLock.store(nullptr);
|
||||||
|
}
|
||||||
|
}
|
@ -37,6 +37,8 @@ public:
|
|||||||
|
|
||||||
bool getSquelchBreak();
|
bool getSquelchBreak();
|
||||||
|
|
||||||
|
static void releaseSquelchLock(DemodulatorInstance *inst);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
float abMagnitude(double alpha, double beta, float inphase, float quadrature);
|
float abMagnitude(double alpha, double beta, float inphase, float quadrature);
|
||||||
|
Loading…
Reference in New Issue
Block a user