1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-07-26 03:54:30 -04:00

Fixed possible sample device pointer not set yet when DSPMIMOSignalNotification message arrives. Fixes #1529

This commit is contained in:
f4exb
2022-12-28 18:55:06 +01:00
parent b387de17bc
commit 12deb59bf4
3 changed files with 78 additions and 79 deletions
+14 -15
View File
@@ -267,8 +267,7 @@ DSPDeviceSinkEngine::State DSPDeviceSinkEngine::gotoIdle()
break;
}
if(m_deviceSampleSink == 0)
{
if (!m_deviceSampleSink) {
return StIdle;
}
@@ -304,8 +303,7 @@ DSPDeviceSinkEngine::State DSPDeviceSinkEngine::gotoInit()
break;
}
if (m_deviceSampleSink == 0)
{
if (!m_deviceSampleSink) {
return gotoError("DSPDeviceSinkEngine::gotoInit: No sample source configured");
}
@@ -362,7 +360,7 @@ DSPDeviceSinkEngine::State DSPDeviceSinkEngine::gotoRunning()
break;
}
if(m_deviceSampleSink == 0) {
if (!m_deviceSampleSink) {
return gotoError("DSPDeviceSinkEngine::gotoRunning: No sample source configured");
}
@@ -370,8 +368,7 @@ DSPDeviceSinkEngine::State DSPDeviceSinkEngine::gotoRunning()
// Start everything
if(!m_deviceSampleSink->start())
{
if (!m_deviceSampleSink->start()) {
return gotoError("DSPDeviceSinkEngine::gotoRunning: Could not start sample sink");
}
@@ -533,15 +530,17 @@ void DSPDeviceSinkEngine::handleInputMessages()
}
// forward changes to listeners on DSP output queue
if (m_deviceSampleSink)
{
MessageQueue *guiMessageQueue = m_deviceSampleSink->getMessageQueueToGUI();
qDebug("DSPDeviceSinkEngine::handleInputMessages: DSPSignalNotification: guiMessageQueue: %p", guiMessageQueue);
MessageQueue *guiMessageQueue = m_deviceSampleSink->getMessageQueueToGUI();
qDebug("DSPDeviceSinkEngine::handleInputMessages: DSPSignalNotification: guiMessageQueue: %p", guiMessageQueue);
if (guiMessageQueue)
{
DSPSignalNotification* rep = new DSPSignalNotification(*notif); // make a copy for the output queue
guiMessageQueue->push(rep);
}
if (guiMessageQueue)
{
DSPSignalNotification* rep = new DSPSignalNotification(*notif); // make a copy for the output queue
guiMessageQueue->push(rep);
}
}
delete message;
}