From 7e22fc06165e6eb4ca74e228a9677905e12b1454 Mon Sep 17 00:00:00 2001
From: Kurt Korbatits <kurt.korbatits@nokia.com>
Date: Fri, 18 Dec 2009 10:56:28 +1000
Subject: no audiodevices found using QAudioDeviceInfo::availableDevices on
 Ubuntu

Task-number:QTBUG-6866
Reviewed-by:Justin McPherson
---
 src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp b/src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp
index 9645fa8..f58f5be 100644
--- a/src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp
+++ b/src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp
@@ -403,6 +403,7 @@ void QAudioDeviceInfoInternal::updateLists()
 
 QList<QByteArray> QAudioDeviceInfoInternal::availableDevices(QAudio::Mode mode)
 {
+    QList<QByteArray> allDevices;
     QList<QByteArray> devices;
     QByteArray filter;
 
@@ -430,6 +431,7 @@ QList<QByteArray> QAudioDeviceInfoInternal::availableDevices(QAudio::Mode mode)
         if((name != NULL) && (descr != NULL) && ((io == NULL) || (io == filter))) {
             QString deviceName = QLatin1String(name);
             QString deviceDescription = QLatin1String(descr);
+            allDevices.append(deviceName.toLocal8Bit().constData());
             if(deviceDescription.contains(QLatin1String("Default Audio Device")))
                 devices.append(deviceName.toLocal8Bit().constData());
         }
@@ -457,6 +459,9 @@ QList<QByteArray> QAudioDeviceInfoInternal::availableDevices(QAudio::Mode mode)
     if (idx > 0)
         devices.append("default");
 #endif
+    if (devices.size() == 0 && allDevices.size() > 0)
+        return allDevices;
+
     return devices;
 }
 
-- 
cgit v0.12