From 4e102ad86d86a1384ad8332da5ba69a1b0811f31 Mon Sep 17 00:00:00 2001 From: f4exb Date: Tue, 21 Feb 2017 06:14:47 +0100 Subject: [PATCH] RTLSDR: restored gain setting --- plugins/samplesource/rtlsdr/rtlsdrinput.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/plugins/samplesource/rtlsdr/rtlsdrinput.cpp b/plugins/samplesource/rtlsdr/rtlsdrinput.cpp index 69c1d42ee..cfd8b08d1 100644 --- a/plugins/samplesource/rtlsdr/rtlsdrinput.cpp +++ b/plugins/samplesource/rtlsdr/rtlsdrinput.cpp @@ -220,6 +220,19 @@ bool RTLSDRInput::applySettings(const RTLSDRSettings& settings, bool force) { bool forwardChange = false; + if ((m_settings.m_gain != settings.m_gain) || force) + { + m_settings.m_gain = settings.m_gain; + + if(m_dev != 0) + { + if(rtlsdr_set_tuner_gain(m_dev, m_settings.m_gain) != 0) + { + qDebug("rtlsdr_set_tuner_gain() failed"); + } + } + } + if ((m_settings.m_dcBlock != settings.m_dcBlock) || force) { m_settings.m_dcBlock = settings.m_dcBlock;