[Android] VLCOptions: inverse MEDIA_NO_VIDEO flag

Thomas Guillem git at videolan.org
Tue Jul 7 11:19:14 CEST 2015


vlc-ports/android | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Jul  7 11:17:11 2015 +0200| [8836fe2aa88c30aed65c85a2679d136317109a47] | committer: Thomas Guillem

VLCOptions: inverse MEDIA_NO_VIDEO flag

By default, video is deactivated, add MEDIA_VIDEO flag to activate video.

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

 vlc-android/src/org/videolan/vlc/PlaybackService.java              |    2 --
 .../src/org/videolan/vlc/gui/video/VideoPlayerActivity.java        |    1 +
 vlc-android/src/org/videolan/vlc/util/VLCOptions.java              |    4 ++--
 3 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/PlaybackService.java b/vlc-android/src/org/videolan/vlc/PlaybackService.java
index ae70d44..36b1b1f 100644
--- a/vlc-android/src/org/videolan/vlc/PlaybackService.java
+++ b/vlc-android/src/org/videolan/vlc/PlaybackService.java
@@ -1539,8 +1539,6 @@ public class PlaybackService extends Service {
         if (mw == null)
             return;
 
-        if (!mVideoEnabled)
-            flags |= VLCOptions.MEDIA_NO_VIDEO;
         final Media media = new Media(VLCInstance.get(), mw.getUri());
         VLCOptions.setMediaOptions(media, this, flags | mw.getFlags());
         media.setEventListener(mMediaListener);
diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
index 13efa62..4822e40 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -2625,6 +2625,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
                     mw.addFlags(VLCOptions.MEDIA_PAUSED);
                 if (mHardwareAccelerationError)
                     mw.addFlags(VLCOptions.MEDIA_NO_HWACCEL);
+                mw.addFlags(VLCOptions.MEDIA_VIDEO);
                 mService.addCallback(this);
                 mService.load(mw);
                 savedIndexPosition = mService.getCurrentMediaPosition();
diff --git a/vlc-android/src/org/videolan/vlc/util/VLCOptions.java b/vlc-android/src/org/videolan/vlc/util/VLCOptions.java
index 2fe6c94..6fb227e 100644
--- a/vlc-android/src/org/videolan/vlc/util/VLCOptions.java
+++ b/vlc-android/src/org/videolan/vlc/util/VLCOptions.java
@@ -49,7 +49,7 @@ public class VLCOptions {
     public static final int HW_ACCELERATION_DECODING = 1;
     public static final int HW_ACCELERATION_FULL = 2;
 
-    public final static int MEDIA_NO_VIDEO = 0x01;
+    public final static int MEDIA_VIDEO = 0x01;
     public final static int MEDIA_NO_HWACCEL = 0x02;
     public final static int MEDIA_PAUSED = 0x4;
 
@@ -148,7 +148,7 @@ public class VLCOptions {
 
     public static void setMediaOptions(Media media, Context context, int flags) {
         boolean noHardwareAcceleration = (flags & MEDIA_NO_HWACCEL) != 0;
-        boolean noVideo = (flags & MEDIA_NO_VIDEO) != 0;
+        boolean noVideo = (flags & MEDIA_VIDEO) == 0;
         final boolean paused = (flags & MEDIA_PAUSED) != 0;
         int hardwareAcceleration = HW_ACCELERATION_DISABLED;
 



More information about the Android mailing list