summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLisandro Damián Nicanor Pérez Meyer <perezmeyer@gmail.com>2016-03-05 10:36:42 -0300
committerLisandro Damián Nicanor Pérez Meyer <perezmeyer@gmail.com>2016-03-10 12:42:42 +0000
commit680cc0c97431de03487206fee575fa89c24b8842 (patch)
tree44bc6fba02f90c810627d56f209d29ebe536d6f0
parent77c9ab4a3871110c6fb569c4e7b17181867c17ad (diff)
ALSA: simplify checking the available version.
Make use of SND_LIB_VERSION instead of SND_LIB_[MAJOR MINOR SUBMINOR] in order to simplify the tests. Task-number: QTBUG-51681 Change-Id: Ib9f28ff15ddc643cc426ded3a5779fb4ff651139 Reviewed-by: Dmitry Shachnev <mitya57@gmail.com> Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
-rw-r--r--config.tests/alsa/alsatest.cpp2
-rw-r--r--src/plugins/alsa/qalsaaudiodeviceinfo.cpp8
-rw-r--r--src/plugins/alsa/qalsaaudioinput.cpp4
-rw-r--r--src/plugins/alsa/qalsaaudiooutput.cpp4
4 files changed, 9 insertions, 9 deletions
diff --git a/config.tests/alsa/alsatest.cpp b/config.tests/alsa/alsatest.cpp
index 1b59cb17b..0b45819b6 100644
--- a/config.tests/alsa/alsatest.cpp
+++ b/config.tests/alsa/alsatest.cpp
@@ -32,7 +32,7 @@
****************************************************************************/
#include <alsa/asoundlib.h>
-#if (!(SND_LIB_MAJOR == 1 && (SND_LIB_MINOR > 0 || SND_LIB_SUBMINOR >= 10)))
+#if SND_LIB_VERSION < 0x1000a // 1.0.10
#error "Alsa version found too old, require >= 1.0.10"
#endif
diff --git a/src/plugins/alsa/qalsaaudiodeviceinfo.cpp b/src/plugins/alsa/qalsaaudiodeviceinfo.cpp
index 3d310871f..31ad47ce8 100644
--- a/src/plugins/alsa/qalsaaudiodeviceinfo.cpp
+++ b/src/plugins/alsa/qalsaaudiodeviceinfo.cpp
@@ -141,7 +141,7 @@ bool QAlsaAudioDeviceInfo::open()
QList<QByteArray> devices = availableDevices(mode);
if(dev.compare(QLatin1String("default")) == 0) {
-#if (SND_LIB_MAJOR == 1 && (SND_LIB_MINOR > 0 || SND_LIB_SUBMINOR >= 14))
+#if SND_LIB_VERSION >= 0x1000e // 1.0.14
if (devices.size() > 0)
dev = QLatin1String(devices.first().constData());
else
@@ -150,7 +150,7 @@ bool QAlsaAudioDeviceInfo::open()
dev = QLatin1String("hw:0,0");
#endif
} else {
-#if (SND_LIB_MAJOR == 1 && (SND_LIB_MINOR > 0 || SND_LIB_SUBMINOR >= 14))
+#if SND_LIB_VERSION >= 0x1000e // 1.0.14
dev = device;
#else
int idx = 0;
@@ -194,7 +194,7 @@ bool QAlsaAudioDeviceInfo::testSettings(const QAudioFormat& format) const
snd_pcm_hw_params_t *params;
QString dev;
-#if (SND_LIB_MAJOR == 1 && (SND_LIB_MINOR > 0 || SND_LIB_SUBMINOR >= 14))
+#if SND_LIB_VERSION >= 0x1000e // 1.0.14
dev = device;
if (dev.compare(QLatin1String("default")) == 0) {
QList<QByteArray> devices = availableDevices(QAudio::AudioOutput);
@@ -335,7 +335,7 @@ QList<QByteArray> QAlsaAudioDeviceInfo::availableDevices(QAudio::Mode mode)
QList<QByteArray> devices;
QByteArray filter;
-#if (SND_LIB_MAJOR == 1 && (SND_LIB_MINOR > 0 || SND_LIB_SUBMINOR >= 14))
+#if SND_LIB_VERSION >= 0x1000e // 1.0.14
// Create a list of all current audio devices that support mode
void **hints, **n;
char *name, *descr, *io;
diff --git a/src/plugins/alsa/qalsaaudioinput.cpp b/src/plugins/alsa/qalsaaudioinput.cpp
index d6d8adcff..d9c775148 100644
--- a/src/plugins/alsa/qalsaaudioinput.cpp
+++ b/src/plugins/alsa/qalsaaudioinput.cpp
@@ -303,7 +303,7 @@ bool QAlsaAudioInput::open()
QString dev = QString(QLatin1String(m_device.constData()));
QList<QByteArray> devices = QAlsaAudioDeviceInfo::availableDevices(QAudio::AudioInput);
if(dev.compare(QLatin1String("default")) == 0) {
-#if (SND_LIB_MAJOR == 1 && (SND_LIB_MINOR > 0 || SND_LIB_SUBMINOR >= 14))
+#if SND_LIB_VERSION >= 0x1000e // 1.0.14
if (devices.size() > 0)
dev = QLatin1String(devices.first());
else
@@ -312,7 +312,7 @@ bool QAlsaAudioInput::open()
dev = QLatin1String("hw:0,0");
#endif
} else {
-#if (SND_LIB_MAJOR == 1 && (SND_LIB_MINOR > 0 || SND_LIB_SUBMINOR >= 14))
+#if SND_LIB_VERSION >= 0x1000e // 1.0.14
dev = QLatin1String(m_device);
#else
int idx = 0;
diff --git a/src/plugins/alsa/qalsaaudiooutput.cpp b/src/plugins/alsa/qalsaaudiooutput.cpp
index a382b666a..5702cfc78 100644
--- a/src/plugins/alsa/qalsaaudiooutput.cpp
+++ b/src/plugins/alsa/qalsaaudiooutput.cpp
@@ -306,7 +306,7 @@ bool QAlsaAudioOutput::open()
QString dev = QString(QLatin1String(m_device.constData()));
QList<QByteArray> devices = QAlsaAudioDeviceInfo::availableDevices(QAudio::AudioOutput);
if(dev.compare(QLatin1String("default")) == 0) {
-#if (SND_LIB_MAJOR == 1 && (SND_LIB_MINOR > 0 || SND_LIB_SUBMINOR >= 14))
+#if SND_LIB_VERSION >= 0x1000e // 1.0.14
if (devices.size() > 0)
dev = QLatin1String(devices.first());
else
@@ -315,7 +315,7 @@ bool QAlsaAudioOutput::open()
dev = QLatin1String("hw:0,0");
#endif
} else {
-#if (SND_LIB_MAJOR == 1 && (SND_LIB_MINOR > 0 || SND_LIB_SUBMINOR >= 14))
+#if SND_LIB_VERSION >= 0x1000e // 1.0.14
dev = QLatin1String(m_device);
#else
int idx = 0;