summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRhys Weatherley <rhys.weatherley@nokia.com>2009-10-06 00:35:59 (GMT)
committerRhys Weatherley <rhys.weatherley@nokia.com>2009-10-06 00:35:59 (GMT)
commit32b74ee804d6e79420ba00683c7fff1cc8d56230 (patch)
treedcb8dde075f0001342a45195cd09b6c0b2087d3c
parent0bdb0d61d8eea356b1ac7d09ced6dee26d89ee8d (diff)
parentba11343826229e983cb1d38811c8363d355e2e01 (diff)
downloadQt-32b74ee804d6e79420ba00683c7fff1cc8d56230.zip
Qt-32b74ee804d6e79420ba00683c7fff1cc8d56230.tar.gz
Qt-32b74ee804d6e79420ba00683c7fff1cc8d56230.tar.bz2
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6
-rw-r--r--src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp26
1 files changed, 9 insertions, 17 deletions
diff --git a/src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp b/src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp
index dc24875..55020a6 100644
--- a/src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp
+++ b/src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp
@@ -360,33 +360,30 @@ void QAudioDeviceInfoInternal::updateLists()
QList<QByteArray> QAudioDeviceInfoInternal::deviceList(QAudio::Mode mode)
{
- QAudio::Mode _m;
QList<QByteArray> devices;
QByteArray filter;
- QString dir;
// Create a list of all current audio devices that support mode
void **hints, **n;
char *name, *descr, *io;
if(snd_device_name_hint(-1, "pcm", &hints) < 0) {
- qWarning()<<"no alsa devices available";
+ qWarning() << "no alsa devices available";
return devices;
}
n = hints;
+ if(mode == QAudio::AudioInput) {
+ filter = "Input";
+ } else {
+ filter = "Output";
+ }
+
while (*n != NULL) {
- _m = QAudio::AudioOutput;
name = snd_device_name_get_hint(*n, "NAME");
descr = snd_device_name_get_hint(*n, "DESC");
io = snd_device_name_get_hint(*n, "IOID");
- dir = QString::fromUtf8(io);
- if((name != NULL) && (descr != NULL) && ((io == NULL) || (dir.length() ==filter.length()))) {
- if(dir.length() == 5)
- _m = QAudio::AudioInput;
- if(io == NULL)
- _m = mode;
-
+ if((name != NULL) && (descr != NULL) && ((io == NULL) || (io == filter))) {
QString str = QLatin1String(name);
if(str.contains(QLatin1String("default"))) {
@@ -400,17 +397,12 @@ QList<QByteArray> QAudioDeviceInfoInternal::deviceList(QAudio::Mode mode)
free(descr);
if(io != NULL)
free(io);
- n++;
+ ++n;
}
snd_device_name_free_hint(hints);
if(devices.size() > 0) {
devices.append("default");
- if(mode == QAudio::AudioInput) {
- filter.append("Input");
- } else {
- filter.append("Output");
- }
}
return devices;