Skip to content
Snippets Groups Projects
Commit a5bcbabe authored by Andreas Traczyk's avatar Andreas Traczyk
Browse files

portaudiolayer: use device type to get device index

Change-Id: I44544221d4262699c75a644aa4fd67390a1c9a87
parent 227c8d1c
No related branches found
No related tags found
No related merge requests found
......@@ -104,21 +104,21 @@ int
PortAudioLayer::getAudioDeviceIndex(const std::string& name, DeviceType type) const
{
int numDevices = 0;
(void) type;
auto deviceList = pimpl_->getDeviceByType(type);
numDevices = Pa_GetDeviceCount();
int numDevices = 0;
numDevices = deviceList.size();
if (numDevices < 0) {
JAMI_ERR("PortAudioLayer error : %s", Pa_GetErrorText(numDevices));
} else {
const PaDeviceInfo* deviceInfo;
for (int i = 0; i < numDevices; i++) {
deviceInfo = Pa_GetDeviceInfo(i);
if (deviceInfo->name == name)
int i = 0;
for (auto d = deviceList.cbegin(); d != deviceList.cend(); ++d, ++i) {
if (*d == name) {
return i;
}
}
}
return -1;
return paNoDevice;
}
std::string
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment