From 428128118a9d652d47a58b9b5dfbc520eb171b34 Mon Sep 17 00:00:00 2001 From: f4exb Date: Thu, 1 Apr 2021 06:14:56 +0200 Subject: [PATCH] DATV demod: Do video stream cleamup when re-initializing DATV framework. Reduce videoThreadTimeoutMs to 500 ms --- plugins/channelrx/demoddatv/datvdemodsink.cpp | 7 +++++-- plugins/channelrx/demoddatv/datvideorender.h | 2 +- plugins/channelrx/demoddatv/datvideostream.h | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/plugins/channelrx/demoddatv/datvdemodsink.cpp b/plugins/channelrx/demoddatv/datvdemodsink.cpp index d7941c98f..19e5406bb 100644 --- a/plugins/channelrx/demoddatv/datvdemodsink.cpp +++ b/plugins/channelrx/demoddatv/datvdemodsink.cpp @@ -173,7 +173,6 @@ bool DATVDemodSink::playVideo() if (m_objVideoStream->bytesAvailable() > 0) { - m_objRenderThread->setStreamAndRenderer(m_objRegisteredVideoRender, m_objVideoStream); m_objVideoStream->MultiThreaded = true; m_objVideoStream->ThreadTimeOut = DATVideoRenderThread::videoThreadTimeoutMs; m_objRenderThread->start(); @@ -184,6 +183,10 @@ bool DATVDemodSink::playVideo() void DATVDemodSink::CleanUpDATVFramework() { + if (m_objVideoStream) { + m_objVideoStream->cleanUp(); + } + if (m_objScheduler != nullptr) { m_objScheduler->shutdown(); @@ -892,7 +895,7 @@ void DATVDemodSink::InitDATVS2Framework() m_objCfg.fastlock = m_settings.m_fastLock; m_objCfg.sampler = m_settings.m_filter; - m_objCfg.rolloff = m_settings.m_rollOff * 1.001f; //0...1 and correct 0.2 bug + m_objCfg.rolloff = m_settings.m_rollOff * 0.999f; //0...1 and correct 0.2 bug m_objCfg.rrc_rej = (float) m_settings.m_excursion; //dB m_objCfg.rrc_steps = 0; //auto diff --git a/plugins/channelrx/demoddatv/datvideorender.h b/plugins/channelrx/demoddatv/datvideorender.h index b891d9398..77bee4b52 100644 --- a/plugins/channelrx/demoddatv/datvideorender.h +++ b/plugins/channelrx/demoddatv/datvideorender.h @@ -238,7 +238,7 @@ class DATVideoRenderThread : public QThread m_renderingVideo = false; } - static const int videoThreadTimeoutMs = 2000; + static const int videoThreadTimeoutMs = 500; private: DATVideoRender *m_renderer; diff --git a/plugins/channelrx/demoddatv/datvideostream.h b/plugins/channelrx/demoddatv/datvideostream.h index 93962e8ef..f429a009f 100644 --- a/plugins/channelrx/demoddatv/datvideostream.h +++ b/plugins/channelrx/demoddatv/datvideostream.h @@ -43,6 +43,7 @@ public: int pushData(const char * chrData, int intSize); bool setMemoryLimit(int intMemoryLimit); void resetTotalReceived(); + void cleanUp(); virtual bool isSequential() const; virtual qint64 bytesAvailable() const; @@ -74,7 +75,6 @@ private: qint64 m_intTotalReceived; qint64 m_intPacketReceived; - void cleanUp(); }; #endif // DATVIDEOSTREAM_H