Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
savoirfairelinux
jami-daemon
Commits
a5bcbabe
Commit
a5bcbabe
authored
Jun 18, 2019
by
Andreas Traczyk
Browse files
portaudiolayer: use device type to get device index
Change-Id: I44544221d4262699c75a644aa4fd67390a1c9a87
parent
227c8d1c
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/media/audio/portaudio/portaudiolayer.cpp
View file @
a5bcbabe
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment