Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
msaaudio
Commits
f822af1c
Commit
f822af1c
authored
Mar 12, 2020
by
Andrea Gianarda
Browse files
getDeviceId JV function has been renamed getDefaultDeviceId
parent
332082e9
Changes
1
Hide whitespace changes
Inline
Side-by-side
msaaudio_player.cpp
View file @
f822af1c
...
...
@@ -97,14 +97,14 @@ struct AAudioOutputContext {
jclass
androidAudioManagerClass
=
env
->
FindClass
(
mgrJVCName
.
c_str
());
if
((
jPlayerObj
!=
NULL
)
&&
(
androidAudioManagerClass
!=
NULL
))
{
jmethodID
getDeviceID
=
env
->
GetMethodID
(
androidAudioManagerClass
,
"getDeviceId"
,
"(Ljava/lang/String;Ljava/lang/String;)I"
);
if
(
getDeviceID
!=
NULL
)
{
jmethodID
getDe
faultDe
viceID
=
env
->
GetMethodID
(
androidAudioManagerClass
,
"getDe
faultDe
viceId"
,
"(Ljava/lang/String;Ljava/lang/String;)I"
);
if
(
getDe
faultDe
viceID
!=
NULL
)
{
const
std
::
string
direction
(
"output"
);
// Convert C++ strings to jstrign in order to pass them to the JAVA code
jstring
jDirection
=
env
->
NewStringUTF
(
direction
.
c_str
());
jstring
jStreamType
=
env
->
NewStringUTF
(
streamTypeStr
.
c_str
());
jint
id
=
env
->
CallIntMethod
(
jPlayerObj
,
getDeviceID
,
jDirection
,
jStreamType
);
jint
id
=
env
->
CallIntMethod
(
jPlayerObj
,
getDe
faultDe
viceID
,
jDirection
,
jStreamType
);
// id is -1 if an error occurred or no device was found
// In such scenario, do not change the device ID
if
(
id
!=
-
1
)
deviceId
=
(
int
)
id
;
...
...
Write
Preview
Markdown
is supported
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