[Android] Change the way we store subs extensions

Geoffrey Métais git at videolan.org
Wed Jan 21 19:20:08 CET 2015


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Jan 20 18:52:34 2015 +0100| [5d763338a4070fcd9f71cc569e63b2dca1e7aff3] | committer: Geoffrey Métais

Change the way we store subs extensions

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

 libvlc/src/org/videolan/libvlc/util/Extensions.java              |    6 +++---
 .../src/org/videolan/vlc/gui/video/MediaInfoFragment.java        |    2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/libvlc/src/org/videolan/libvlc/util/Extensions.java b/libvlc/src/org/videolan/libvlc/util/Extensions.java
index b1f9605..e641a63 100644
--- a/libvlc/src/org/videolan/libvlc/util/Extensions.java
+++ b/libvlc/src/org/videolan/libvlc/util/Extensions.java
@@ -45,9 +45,9 @@ public class Extensions {
                 ".voc", ".vqf", ".w64", ".wav", ".wma", ".wv", ".xa", ".xm" };
 
         final String[] subtitlesExtensions = {
-                "idx", "sub",  "srt", "ssa", "ass",  "smi", "utf", "utf8", "utf-8",
-                "rt",   "aqt", "txt", "usf", "jss",  "cdg", "psb", "mpsub","mpl2",
-                "pjs", "dks", "stl", "vtt" };
+                ".idx", ".sub",  ".srt", ".ssa", ".ass",  ".smi", ".utf", ".utf8", ".utf-8",
+                ".rt",   ".aqt", ".txt", ".usf", ".jss",  ".cdg", ".psb", ".mpsub",".mpl2",
+                ".pjs", ".dks", ".stl", ".vtt" };
 
         VIDEO = new HashSet<String>();
         for (String item : videoExtensions)
diff --git a/vlc-android/src/org/videolan/vlc/gui/video/MediaInfoFragment.java b/vlc-android/src/org/videolan/vlc/gui/video/MediaInfoFragment.java
index dd7d8e0..e64cdd3 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/MediaInfoFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/MediaInfoFragment.java
@@ -173,7 +173,7 @@ public class MediaInfoFragment extends ListFragment {
         }
         for (int i = 0; i<files.length ; ++i){
             filename = Uri.decode(files[i]);
-            extension = filename.substring(filename.lastIndexOf('.')+1);
+            extension = filename.substring(filename.lastIndexOf('.'));
             if (!Extensions.SUBTITLES.contains(extension))
                 continue;
             if (filename.startsWith(videoName)) {



More information about the Android mailing list