[Android] MediaPlayer: set setVideoTrackEnabled public

Thomas Guillem git at videolan.org
Fri Nov 27 17:07:28 CET 2015


vlc-ports/android | branch: master | Thomas Guillem <thomas at gllm.fr> | Thu Nov 26 14:44:45 2015 +0100| [69c8ce6b9822e020f50da5e0af472515ef494586] | committer: Geoffrey Métais

MediaPlayer: set setVideoTrackEnabled public

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=69c8ce6b9822e020f50da5e0af472515ef494586
---

 libvlc/src/org/videolan/libvlc/MediaPlayer.java |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/libvlc/src/org/videolan/libvlc/MediaPlayer.java b/libvlc/src/org/videolan/libvlc/MediaPlayer.java
index 2eab202..32e67a0 100644
--- a/libvlc/src/org/videolan/libvlc/MediaPlayer.java
+++ b/libvlc/src/org/videolan/libvlc/MediaPlayer.java
@@ -551,10 +551,15 @@ public class MediaPlayer extends VLCObject<MediaPlayer.Event> {
         return nativeSetVideoTrack(index);
     }
 
-    private void setVideoTrackEnabled(boolean enabled) {
+    /**
+     * Set the enabled state of the video track
+     *
+     * @param enabled
+     */
+    public void setVideoTrackEnabled(boolean enabled) {
         if (!enabled) {
             setVideoTrack(-1);
-        } else {
+        } else if (getVideoTrack() == -1) {
             final MediaPlayer.TrackDescription tracks[] = getVideoTracks();
 
             if (tracks != null) {



More information about the Android mailing list