Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Ewout ter Hoeven
VLC-Android
Commits
b8fd87d2
Commit
b8fd87d2
authored
Mar 26, 2018
by
Thomas Guillem
Committed by
Geoffrey Métais
Mar 26, 2018
Browse files
LibVLC: MediaPlayer: add forceAudioDigitalEncodings()
parent
c5cb324d
Changes
1
Hide whitespace changes
Inline
Side-by-side
libvlc/src/org/videolan/libvlc/MediaPlayer.java
View file @
b8fd87d2
...
...
@@ -764,6 +764,28 @@ public class MediaPlayer extends VLCObject<MediaPlayer.Event> {
return
true
;
}
/** Convenient method for {@link #setAudioOutputDevice}
*
* @param encodings list of encodings to play via passthrough (see AudioFormat.ENCODING_*),
* null to don't force any.
* @return true on success
*/
public
synchronized
boolean
forceAudioDigitalEncodings
(
int
[]
encodings
)
{
if
(!
isAudioTrack
())
return
false
;
if
(
encodings
.
length
==
0
)
setAudioOutputDeviceInternal
(
null
,
true
);
else
{
final
String
newDeviceId
=
"encoded:"
+
getEncodingFlags
(
encodings
);
if
(!
newDeviceId
.
equals
(
mAudioPlugOutputDevice
))
{
mAudioPlugOutputDevice
=
newDeviceId
;
setAudioOutputDeviceInternal
(
mAudioPlugOutputDevice
,
true
);
}
}
return
true
;
}
private
synchronized
boolean
setAudioOutputDeviceInternal
(
String
id
,
boolean
fromUser
)
{
mAudioOutputDevice
=
id
;
if
(
fromUser
)
{
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment