From 8801462f960acfddb4b2e6239ca9024e955e4853 Mon Sep 17 00:00:00 2001 From: f4exb Date: Tue, 2 Jan 2018 00:27:45 +0100 Subject: [PATCH] DSP device sink engine: simplify code for single channel source handling --- sdrbase/dsp/dspdevicesinkengine.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/sdrbase/dsp/dspdevicesinkengine.cpp b/sdrbase/dsp/dspdevicesinkengine.cpp index ff5884dbc..93143e641 100644 --- a/sdrbase/dsp/dspdevicesinkengine.cpp +++ b/sdrbase/dsp/dspdevicesinkengine.cpp @@ -178,15 +178,11 @@ void DSPDeviceSinkEngine::work(int nbWriteSamples) if ((m_threadedBasebandSampleSources.size() + m_basebandSampleSources.size()) == 1) { // qDebug("DSPDeviceSinkEngine::work: single channel source handling"); - - for (ThreadedBasebandSampleSources::iterator it = m_threadedBasebandSampleSources.begin(); it != m_threadedBasebandSampleSources.end(); ++it) - { - (*it)->feed(sampleFifo, nbWriteSamples); - } - for (BasebandSampleSources::iterator it = m_basebandSampleSources.begin(); it != m_basebandSampleSources.end(); ++it) - { - (*it)->feed(sampleFifo, nbWriteSamples); - } + if (m_threadedBasebandSampleSources.size() == 1) { + m_threadedBasebandSampleSources.back()->feed(sampleFifo, nbWriteSamples); + } else if (m_basebandSampleSources.size() == 1) { + m_basebandSampleSources.back()->feed(sampleFifo, nbWriteSamples); + } } // multiple channel sources handling else if ((m_threadedBasebandSampleSources.size() + m_basebandSampleSources.size()) > 1)