summaryrefslogtreecommitdiffstats
path: root/src/gsttools
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@theqtcompany.com>2015-03-17 09:48:51 +0100
committerFrederik Gladhorn <frederik.gladhorn@theqtcompany.com>2015-03-17 09:48:51 +0100
commit64b75cc1d7ab1c3a557c809e15154d5d3a03d1ad (patch)
treefc77380849c882da0dbc3c96f4fbbf92b0c21d33 /src/gsttools
parentd109e6dd5d6a18e715b979f3d3ef845946b1b787 (diff)
parentd4208cc5a1c6d6bf114653b39b8880fe4c00c1f3 (diff)
Merge remote-tracking branch 'origin/5.4' into 5.5
Diffstat (limited to 'src/gsttools')
-rw-r--r--src/gsttools/qgstreameraudioinputselector.cpp49
1 files changed, 23 insertions, 26 deletions
diff --git a/src/gsttools/qgstreameraudioinputselector.cpp b/src/gsttools/qgstreameraudioinputselector.cpp
index df1b95748..52587e075 100644
--- a/src/gsttools/qgstreameraudioinputselector.cpp
+++ b/src/gsttools/qgstreameraudioinputselector.cpp
@@ -111,36 +111,33 @@ void QGstreamerAudioInputSelector::updateAlsaDevices()
{
#ifdef HAVE_ALSA
void **hints, **n;
- int card = -1;
-
- while (snd_card_next(&card) == 0 && card >= 0) {
- if (snd_device_name_hint(card, "pcm", &hints) < 0)
- continue;
-
- n = hints;
- while (*n != NULL) {
- char *name = snd_device_name_get_hint(*n, "NAME");
- char *descr = snd_device_name_get_hint(*n, "DESC");
- char *io = snd_device_name_get_hint(*n, "IOID");
-
- if ((name != NULL) && (descr != NULL)) {
- if ( io == NULL || qstrcmp(io,"Input") == 0 ) {
- m_names.append(QLatin1String("alsa:")+QString::fromUtf8(name));
- m_descriptions.append(QString::fromUtf8(descr));
- }
- }
+ if (snd_device_name_hint(-1, "pcm", &hints) < 0) {
+ qWarning()<<"no alsa devices available";
+ return;
+ }
+ n = hints;
- if (name != NULL)
- free(name);
- if (descr != NULL)
- free(descr);
- if (io != NULL)
- free(io);
- ++n;
+ while (*n != NULL) {
+ char *name = snd_device_name_get_hint(*n, "NAME");
+ char *descr = snd_device_name_get_hint(*n, "DESC");
+ char *io = snd_device_name_get_hint(*n, "IOID");
+
+ if ((name != NULL) && (descr != NULL)) {
+ if ( io == NULL || qstrcmp(io,"Input") == 0 ) {
+ m_names.append(QLatin1String("alsa:")+QString::fromUtf8(name));
+ m_descriptions.append(QString::fromUtf8(descr));
+ }
}
- snd_device_name_free_hint(hints);
+ if (name != NULL)
+ free(name);
+ if (descr != NULL)
+ free(descr);
+ if (io != NULL)
+ free(io);
+ n++;
}
+ snd_device_name_free_hint(hints);
#endif
}