[Android] TS disabling: fix logic fail

Geoffrey Métais git at videolan.org
Wed Nov 8 15:36:54 CET 2017


vlc-android | branch: 2.5.x | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Nov  8 15:35:57 2017 +0100| [9794ace0a613210033a3036d69afc15f4b189b4b] | committer: Geoffrey Métais

TS disabling: fix logic fail

(cherry picked from commit 0774e7169f74688363f6fcd74acbd4be0bea8752)

> https://code.videolan.org/videolan/vlc-android/commit/9794ace0a613210033a3036d69afc15f4b189b4b
---

 .../src/org/videolan/vlc/gui/video/VideoPlayerActivity.java  | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

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 a534c4c1f..b371bd6ac 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -3317,10 +3317,14 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
 
     private boolean enableSubs = true;
     private void enableSubs() {
-        if (mUri == null || mUri.getScheme().startsWith("http")) return;
-        final String lastPath = mUri.getLastPathSegment();
-        enableSubs = !TextUtils.isEmpty(lastPath) && !lastPath.endsWith(".ts") && !lastPath.endsWith(".m2ts")
-                && !lastPath.endsWith(".TS") && !lastPath.endsWith(".M2TS");
+        if (mUri == null) return;
+        if (mUri.getScheme() == null || !mUri.getScheme().startsWith("http")) {
+            enableSubs = true;
+        } else {
+            final String lastPath = mUri.getLastPathSegment();
+            enableSubs = !TextUtils.isEmpty(lastPath) && !lastPath.endsWith(".ts") && !lastPath.endsWith(".m2ts")
+                    && !lastPath.endsWith(".TS") && !lastPath.endsWith(".M2TS");
+        }
     }
 
     private SubtitlesGetTask mSubtitlesGetTask = null;



More information about the Android mailing list