mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-17 13:51:47 -05:00
LimeSDR input: start or stop thread only if not started or stopped
This commit is contained in:
parent
2c5ea336da
commit
44e00e4aeb
@ -397,7 +397,7 @@ bool LimeSDRInput::applySettings(const LimeSDRInputSettings& settings, bool forc
|
||||
bool threadStopped = false;
|
||||
// QMutexLocker mutexLocker(&m_mutex);
|
||||
|
||||
if ((m_deviceShared.m_deviceParams->getDevice() != 0) && m_limeSDRInputThread && m_running &&
|
||||
if ((m_deviceShared.m_deviceParams->getDevice() != 0) && m_limeSDRInputThread &&
|
||||
((m_settings.m_gain != settings.m_gain) ||
|
||||
(m_settings.m_devSampleRate != settings.m_devSampleRate) ||
|
||||
(m_settings.m_log2HardDecim != settings.m_log2HardDecim) ||
|
||||
|
@ -36,6 +36,8 @@ LimeSDRInputThread::~LimeSDRInputThread()
|
||||
|
||||
void LimeSDRInputThread::startWork()
|
||||
{
|
||||
if (m_running) return; // return if running already
|
||||
|
||||
m_startWaitMutex.lock();
|
||||
start();
|
||||
while(!m_running)
|
||||
@ -45,6 +47,8 @@ void LimeSDRInputThread::startWork()
|
||||
|
||||
void LimeSDRInputThread::stopWork()
|
||||
{
|
||||
if (!m_running) return; // return if not running
|
||||
|
||||
m_running = false;
|
||||
wait();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user