This is an automatic generated email to let you know that the following patch 
were queued at the 
http://git.linuxtv.org/cgit.cgi/v4l-utils.git tree:

Subject: qv4l2: fix audio device selection
Author:  Hans Verkuil <[email protected]>
Date:    Mon Nov 30 20:23:31 2015 +0100

Audio devices can have the same name, but belong to different cards.
The lookup within qv4l2 was done via std::map with the current combobox text
as the key. But if multiple combobox entries have the same name they will
all map to the same alsa device.

Make a map with the current combobox index instead.

Signed-off-by: Hans Verkuil <[email protected]>

 utils/qv4l2/general-tab.cpp | 12 ++++++------
 utils/qv4l2/general-tab.h   |  4 ++--
 2 files changed, 8 insertions(+), 8 deletions(-)

---

http://git.linuxtv.org/cgit.cgi/v4l-utils.git/commit/?id=261c1533f7a7de3b321ea0269beaa725e01000a0
diff --git a/utils/qv4l2/general-tab.cpp b/utils/qv4l2/general-tab.cpp
index 689b4ccf783c..fe693106e839 100644
--- a/utils/qv4l2/general-tab.cpp
+++ b/utils/qv4l2/general-tab.cpp
@@ -1037,14 +1037,14 @@ int GeneralTab::addAudioDevice(void *hint, int 
deviceNum)
        }
 
        if ((iotype == NULL || strncmp(iotype, "Input", 5) == 0) && 
filterAudioDevice(deviceName)) {
+               m_audioInDeviceMap[m_audioInDevice->count()] = 
snd_device_name_get_hint(hint, "NAME");
                m_audioInDevice->addItem(listName);
-               m_audioInDeviceMap[listName] = snd_device_name_get_hint(hint, 
"NAME");
                added += AUDIO_ADD_READ;
        }
 
        if ((iotype == NULL || strncmp(iotype, "Output", 6) == 0)  && 
filterAudioDevice(deviceName)) {
+               m_audioOutDeviceMap[m_audioOutDevice->count()] = 
snd_device_name_get_hint(hint, "NAME");
                m_audioOutDevice->addItem(listName);
-               m_audioOutDeviceMap[listName] = snd_device_name_get_hint(hint, 
"NAME");
                added += AUDIO_ADD_WRITE;
        }
 #endif
@@ -1064,8 +1064,8 @@ bool GeneralTab::createAudioDeviceList()
 
        m_audioInDevice->addItem("None");
        m_audioOutDevice->addItem("Default");
-       m_audioInDeviceMap["None"] = "None";
-       m_audioOutDeviceMap["Default"] = "default";
+       m_audioInDeviceMap[0] = "None";
+       m_audioOutDeviceMap[0] = "default";
 
        int deviceNum = -1;
        int audioDevices = 0;
@@ -2342,7 +2342,7 @@ QString GeneralTab::getAudioInDevice()
        if (m_audioInDevice == NULL)
                return NULL;
 
-       return m_audioInDeviceMap[m_audioInDevice->currentText()];
+       return m_audioInDeviceMap[m_audioInDevice->currentIndex()];
 }
 
 QString GeneralTab::getAudioOutDevice()
@@ -2350,7 +2350,7 @@ QString GeneralTab::getAudioOutDevice()
        if (m_audioOutDevice == NULL)
                return NULL;
 
-       return m_audioOutDeviceMap[m_audioOutDevice->currentText()];
+       return m_audioOutDeviceMap[m_audioOutDevice->currentIndex()];
 }
 
 void GeneralTab::setAudioDeviceBufferSize(int size)
diff --git a/utils/qv4l2/general-tab.h b/utils/qv4l2/general-tab.h
index 55ffa180b442..f61d495452d0 100644
--- a/utils/qv4l2/general-tab.h
+++ b/utils/qv4l2/general-tab.h
@@ -321,8 +321,8 @@ private:
        bool m_has_interval;
        int m_audioDeviceBufferSize;
        static bool m_fullAudioName;
-       std::map<QString, QString> m_audioInDeviceMap;
-       std::map<QString, QString> m_audioOutDeviceMap;
+       std::map<int, QString> m_audioInDeviceMap;
+       std::map<int, QString> m_audioOutDeviceMap;
 
        // General tab
        QList<QGridLayout *> m_grids;

_______________________________________________
linuxtv-commits mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to