From 7e375079fe99eaf3cd942b076335a4dd6a256267 Mon Sep 17 00:00:00 2001 From: f4exb Date: Sat, 27 Mar 2021 09:31:09 +0100 Subject: [PATCH] DATV: shut down video player before destruction --- plugins/channelrx/demoddatv/datvdemodbaseband.cpp | 1 + plugins/channelrx/demoddatv/datvdemodsink.cpp | 12 ++++++++---- plugins/channelrx/demoddatv/datvdemodsink.h | 1 + 3 files changed, 10 insertions(+), 4 deletions(-) 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