From 557147d09eb924e66237e4c4f03d73789411f840 Mon Sep 17 00:00:00 2001 From: ericek111 Date: Mon, 18 Jul 2022 15:52:40 +0200 Subject: [PATCH] SDRPlayInput: separate HW flavour from mirisdr_open --- plugins/samplesource/sdrplay/sdrplayinput.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/samplesource/sdrplay/sdrplayinput.cpp b/plugins/samplesource/sdrplay/sdrplayinput.cpp index 7b0599d72..62eb1bfeb 100644 --- a/plugins/samplesource/sdrplay/sdrplayinput.cpp +++ b/plugins/samplesource/sdrplay/sdrplayinput.cpp @@ -103,11 +103,17 @@ bool SDRPlayInput::openDevice() return false; } - if ((res = mirisdr_open(&m_dev, MIRISDR_HW_SDRPLAY, m_devNumber)) < 0) + if ((res = mirisdr_open(&m_dev, m_devNumber)) < 0) { qCritical("SDRPlayInput::openDevice: could not open SDRPlay #%d: %s", m_devNumber, strerror(errno)); return false; } + + if ((res = mirisdr_set_hw_flavour(m_dev, MIRISDR_HW_SDRPLAY)) < 0) + { + qCritical("SDRPlayInput::openDevice: failed to set HW flavour: %s", strerror(errno)); + return false; + } char vendor[256]; char product[256];