1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-02 14:04:46 -04:00

All device plugins: make sure start and stop are effective once only. PArt of #2159

This commit is contained in:
f4exb
2024-08-21 05:27:01 +02:00
committed by Edouard Griffiths
parent 1b37a4f504
commit 585d806ef8
40 changed files with 454 additions and 243 deletions
+14 -5
View File
@@ -414,14 +414,17 @@ void USRPInput::init()
bool USRPInput::start()
{
QMutexLocker mutexLocker(&m_mutex);
if (m_running) {
return true;
}
if (!m_deviceShared.m_deviceParams->getDevice()) {
return false;
}
if (m_running) { stop(); }
if (!acquireChannel())
{
if (!acquireChannel()) {
return false;
}
@@ -441,7 +444,14 @@ bool USRPInput::start()
void USRPInput::stop()
{
QMutexLocker mutexLocker(&m_mutex);
if (!m_running) {
return;
}
qDebug("USRPInput::stop");
m_running = false;
if (m_usrpInputThread)
{
@@ -451,7 +461,6 @@ void USRPInput::stop()
}
m_deviceShared.m_thread = 0;
m_running = false;
releaseChannel();
}