mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-26 09:48:45 -05:00
Perseus: fixed unwanted thread stop at sample rate change
This commit is contained in:
parent
f4bf4d0b99
commit
6cfc99d7d2
@ -301,7 +301,7 @@ bool PerseusInput::applySettings(const PerseusSettings& settings, bool force)
|
|||||||
|
|
||||||
if (m_perseusDescriptor != 0)
|
if (m_perseusDescriptor != 0)
|
||||||
{
|
{
|
||||||
int rate = m_sampleRates[m_settings.m_devSampleRateIndex < m_sampleRates.size() ? m_settings.m_devSampleRateIndex: 0];
|
int rate = m_sampleRates[settings.m_devSampleRateIndex < m_sampleRates.size() ? settings.m_devSampleRateIndex: 0];
|
||||||
int rc = perseus_set_sampling_rate(m_perseusDescriptor, rate);
|
int rc = perseus_set_sampling_rate(m_perseusDescriptor, rate);
|
||||||
|
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
@ -379,6 +379,15 @@ bool PerseusInput::applySettings(const PerseusSettings& settings, bool force)
|
|||||||
m_deviceAPI->getDeviceEngineInputMessageQueue()->push(notif);
|
m_deviceAPI->getDeviceEngineInputMessageQueue()->push(notif);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((m_settings.m_devSampleRateIndex != settings.m_devSampleRateIndex) || force)
|
||||||
|
{
|
||||||
|
if (m_perseusThread && m_perseusThread->isRunning())
|
||||||
|
{
|
||||||
|
m_perseusThread->stopWork();
|
||||||
|
m_perseusThread->startWork();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
m_settings = settings;
|
m_settings = settings;
|
||||||
m_settings.m_devSampleRateIndex = sampleRateIndex;
|
m_settings.m_devSampleRateIndex = sampleRateIndex;
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user