Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jami-libclient
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
savoirfairelinux
jami-libclient
Commits
2bdd0f58
Unverified
Commit
2bdd0f58
authored
5 years ago
by
Sébastien Blin
Browse files
Options
Downloads
Patches
Plain Diff
avmodel: fix media selection
Change-Id: I0c4616142839e155ebbf69182aa3a27b67b14065
parent
6c103318
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/avmodel.cpp
+9
-8
9 additions, 8 deletions
src/avmodel.cpp
with
9 additions
and
8 deletions
src/avmodel.cpp
+
9
−
8
View file @
2bdd0f58
...
@@ -721,10 +721,10 @@ AVModelPimpl::getDevice(int type) const
...
@@ -721,10 +721,10 @@ AVModelPimpl::getDevice(int type) const
std
::
string
result
=
""
;
std
::
string
result
=
""
;
std
::
vector
<
std
::
string
>
devices
;
std
::
vector
<
std
::
string
>
devices
;
switch
(
type
)
{
switch
(
type
)
{
case
0
:
// INPUT
case
1
:
// INPUT
devices
=
linked_
.
getAudioInputDevices
();
devices
=
linked_
.
getAudioInputDevices
();
break
;
break
;
case
1
:
// OUTPUT
case
0
:
// OUTPUT
case
2
:
// RINGTONE
case
2
:
// RINGTONE
devices
=
linked_
.
getAudioOutputDevices
();
devices
=
linked_
.
getAudioOutputDevices
();
break
;
break
;
...
@@ -734,17 +734,18 @@ AVModelPimpl::getDevice(int type) const
...
@@ -734,17 +734,18 @@ AVModelPimpl::getDevice(int type) const
QStringList
currentDevicesIdx
=
ConfigurationManager
::
instance
()
QStringList
currentDevicesIdx
=
ConfigurationManager
::
instance
()
.
getCurrentAudioDevicesIndex
();
.
getCurrentAudioDevicesIndex
();
try
{
try
{
if
(
currentDevicesIdx
.
size
()
<
3
if
(
currentDevicesIdx
.
size
()
<
3
)
{
||
devices
.
size
()
!=
static_cast
<
size_t
>
(
currentDevicesIdx
.
size
()))
{
// Should not happen, but cannot retrieve current ringtone device
// Should not happen, but cannot retrieve current ringtone device
return
""
;
return
""
;
}
}
auto
deviceIdx
=
currentDevicesIdx
[
type
].
toUInt
();
auto
deviceIdx
=
currentDevicesIdx
[
type
].
toUInt
();
if
(
deviceIdx
>=
devices
.
size
())
{
for
(
const
auto
&
dev
:
devices
)
{
// Incorrect device index
int
idx
=
ConfigurationManager
::
instance
().
getAudioInputDeviceIndex
(
dev
.
c_str
());
result
=
devices
[
0
];
if
(
idx
==
deviceIdx
)
{
return
dev
;
}
}
}
re
sult
=
devices
[
deviceIdx
]
;
re
turn
""
;
}
catch
(
std
::
bad_alloc
&
ba
)
{
}
catch
(
std
::
bad_alloc
&
ba
)
{
qWarning
()
<<
"bad_alloc caught: "
<<
ba
.
what
();
qWarning
()
<<
"bad_alloc caught: "
<<
ba
.
what
();
return
""
;
return
""
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment