mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-06-01 21:54:55 -04:00
HackRF output: suspend thread when baseband sample rate changes
This commit is contained in:
@@ -214,11 +214,31 @@ bool HackRFOutput::applySettings(const HackRFOutputSettings& settings, bool forc
|
||||
{
|
||||
// QMutexLocker mutexLocker(&m_mutex);
|
||||
|
||||
bool forwardChange = false;
|
||||
bool forwardChange = false;
|
||||
bool suspendThread = false;
|
||||
bool threadWasRunning = false;
|
||||
hackrf_error rc;
|
||||
|
||||
qDebug() << "HackRFOutput::applySettings";
|
||||
|
||||
if ((m_settings.m_devSampleRate != settings.m_devSampleRate) ||
|
||||
(m_settings.m_log2Interp != settings.m_log2Interp) || force)
|
||||
{
|
||||
suspendThread = true;
|
||||
}
|
||||
|
||||
if (suspendThread)
|
||||
{
|
||||
if (m_hackRFThread)
|
||||
{
|
||||
if (m_hackRFThread->isRunning())
|
||||
{
|
||||
m_hackRFThread->stopWork();
|
||||
threadWasRunning = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ((m_settings.m_devSampleRate != settings.m_devSampleRate) || (m_settings.m_log2Interp != settings.m_log2Interp) || force)
|
||||
{
|
||||
forwardChange = true;
|
||||
@@ -339,6 +359,11 @@ bool HackRFOutput::applySettings(const HackRFOutputSettings& settings, bool forc
|
||||
}
|
||||
}
|
||||
|
||||
if (threadWasRunning)
|
||||
{
|
||||
m_hackRFThread->startWork();
|
||||
}
|
||||
|
||||
m_settings.m_devSampleRate = settings.m_devSampleRate;
|
||||
m_settings.m_log2Interp = settings.m_log2Interp;
|
||||
m_settings.m_centerFrequency = settings.m_centerFrequency;
|
||||
|
||||
Reference in New Issue
Block a user