diff --git a/plugins/channelrx/demoddatv/datvdemodbaseband.cpp b/plugins/channelrx/demoddatv/datvdemodbaseband.cpp index fec19f621..6a0ac77b4 100644 --- a/plugins/channelrx/demoddatv/datvdemodbaseband.cpp +++ b/plugins/channelrx/demoddatv/datvdemodbaseband.cpp @@ -63,6 +63,7 @@ void DATVDemodBaseband::startWork() void DATVDemodBaseband::stopWork() { QMutexLocker mutexLocker(&m_mutex); + m_sink.stopVideo(); disconnect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages())); QObject::disconnect( &m_sampleFifo, diff --git a/plugins/channelrx/demoddatv/datvdemodsink.cpp b/plugins/channelrx/demoddatv/datvdemodsink.cpp index e2ed8dda4..3825e2ac8 100644 --- a/plugins/channelrx/demoddatv/datvdemodsink.cpp +++ b/plugins/channelrx/demoddatv/datvdemodsink.cpp @@ -69,6 +69,14 @@ DATVDemodSink::~DATVDemodSink() m_objVideoStream->deleteLater(); } + stopVideo(); + CleanUpDATVFramework(); + + delete m_objRFFilter; +} + +void DATVDemodSink::stopVideo() +{ if (m_objRenderThread) { if (m_objRenderThread->isRunning()) @@ -78,10 +86,6 @@ DATVDemodSink::~DATVDemodSink() m_objRenderThread->wait(); } } - - CleanUpDATVFramework(); - - delete m_objRFFilter; } bool DATVDemodSink::setTVScreen(TVScreen *objScreen) diff --git a/plugins/channelrx/demoddatv/datvdemodsink.h b/plugins/channelrx/demoddatv/datvdemodsink.h index 42cc9c25f..ab7d29c43 100644 --- a/plugins/channelrx/demoddatv/datvdemodsink.h +++ b/plugins/channelrx/demoddatv/datvdemodsink.h @@ -70,6 +70,7 @@ public: bool videoDecodeOK(); bool playVideo(); + void stopVideo(); int GetSampleRate(); double getMagSq() const { return m_objMagSqAverage; } //!< Beware this is scaled to 2^30