From 4005b70175dc19f5566db68a04b0c866e6d2cba3 Mon Sep 17 00:00:00 2001 From: f4exb Date: Sun, 24 Nov 2019 10:11:50 +0100 Subject: [PATCH] AM, NFM and DSD demod fixes --- plugins/channelrx/demodam/amdemodbaseband.cpp | 4 +++- plugins/channelrx/demoddsd/dsddemodbaseband.cpp | 3 +++ plugins/channelrx/demodnfm/nfmdemodbaseband.cpp | 3 +++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/plugins/channelrx/demodam/amdemodbaseband.cpp b/plugins/channelrx/demodam/amdemodbaseband.cpp index e02a30b22..578420c68 100644 --- a/plugins/channelrx/demodam/amdemodbaseband.cpp +++ b/plugins/channelrx/demodam/amdemodbaseband.cpp @@ -61,12 +61,13 @@ void AMDemodBaseband::reset() void AMDemodBaseband::feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end) { - QMutexLocker mutexLocker(&m_mutex); m_sampleFifo.write(begin, end); } void AMDemodBaseband::handleData() { + QMutexLocker mutexLocker(&m_mutex); + while ((m_sampleFifo.fill() > 0) && (m_inputMessageQueue.size() == 0)) { SampleVector::iterator part1begin; @@ -169,4 +170,5 @@ int AMDemodBaseband::getChannelSampleRate() const void AMDemodBaseband::setBasebandSampleRate(int sampleRate) { m_channelizer->setBasebandSampleRate(sampleRate); + m_sink.applyChannelSettings(m_channelizer->getChannelSampleRate(), m_channelizer->getChannelFrequencyOffset()); } diff --git a/plugins/channelrx/demoddsd/dsddemodbaseband.cpp b/plugins/channelrx/demoddsd/dsddemodbaseband.cpp index be18c39dc..b3bf7824a 100644 --- a/plugins/channelrx/demoddsd/dsddemodbaseband.cpp +++ b/plugins/channelrx/demoddsd/dsddemodbaseband.cpp @@ -68,6 +68,8 @@ void DSDDemodBaseband::feed(const SampleVector::const_iterator& begin, const Sam void DSDDemodBaseband::handleData() { + QMutexLocker mutexLocker(&m_mutex); + while ((m_sampleFifo.fill() > 0) && (m_inputMessageQueue.size() == 0)) { SampleVector::iterator part1begin; @@ -171,4 +173,5 @@ int DSDDemodBaseband::getChannelSampleRate() const void DSDDemodBaseband::setBasebandSampleRate(int sampleRate) { m_channelizer->setBasebandSampleRate(sampleRate); + m_sink.applyChannelSettings(m_channelizer->getChannelSampleRate(), m_channelizer->getChannelFrequencyOffset()); } \ No newline at end of file diff --git a/plugins/channelrx/demodnfm/nfmdemodbaseband.cpp b/plugins/channelrx/demodnfm/nfmdemodbaseband.cpp index 099fa12ed..68ddd7f72 100644 --- a/plugins/channelrx/demodnfm/nfmdemodbaseband.cpp +++ b/plugins/channelrx/demodnfm/nfmdemodbaseband.cpp @@ -65,6 +65,8 @@ void NFMDemodBaseband::feed(const SampleVector::const_iterator& begin, const Sam void NFMDemodBaseband::handleData() { + QMutexLocker mutexLocker(&m_mutex); + while ((m_sampleFifo.fill() > 0) && (m_inputMessageQueue.size() == 0)) { SampleVector::iterator part1begin; @@ -167,4 +169,5 @@ int NFMDemodBaseband::getChannelSampleRate() const void NFMDemodBaseband::setBasebandSampleRate(int sampleRate) { m_channelizer->setBasebandSampleRate(sampleRate); + m_sink.applyChannelSettings(m_channelizer->getChannelSampleRate(), m_channelizer->getChannelFrequencyOffset()); } \ No newline at end of file