[Android] TS disabling: fix logic fail
Geoffrey Métais
git at videolan.org
Wed Nov 8 15:36:23 CET 2017
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Nov 8 15:35:57 2017 +0100| [0774e7169f74688363f6fcd74acbd4be0bea8752] | committer: Geoffrey Métais
TS disabling: fix logic fail
> https://code.videolan.org/videolan/vlc-android/commit/0774e7169f74688363f6fcd74acbd4be0bea8752
---
.../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 23d671b86..41bb9d49e 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -3313,10 +3313,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