[Android] [PATCH 04/10] MediaPlayer: set setVideoTrackEnabled public

Geoffrey Métais geoffrey.metais at gmail.com
Fri Nov 27 13:24:59 CET 2015


From: Thomas Guillem <thomas at gllm.fr>

---
 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) {
-- 
2.5.0



More information about the Android mailing list