[Android] Filter if Uri has query parameters

Geoffrey Métais git at videolan.org
Tue Aug 11 15:07:31 CEST 2015


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Aug 10 18:11:11 2015 +0200| [9b0631f01f188cdacd94be592b3a8b0b18f3ea59] | committer: Geoffrey Métais

Filter if Uri has query parameters

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

 vlc-android/src/org/videolan/vlc/MediaWrapper.java |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/MediaWrapper.java b/vlc-android/src/org/videolan/vlc/MediaWrapper.java
index d9a05c7..b9a5f6b 100644
--- a/vlc-android/src/org/videolan/vlc/MediaWrapper.java
+++ b/vlc-android/src/org/videolan/vlc/MediaWrapper.java
@@ -137,7 +137,12 @@ public class MediaWrapper implements Parcelable {
         }
 
         if (mType == TYPE_ALL) {
-            final String location = mUri.toString();
+            final int index = mUri.toString().indexOf('?');
+            String location;
+            if (index == -1)
+                location = mUri.toString();
+            else
+                location = mUri.toString().substring(0, index);
             int dotIndex = location.lastIndexOf(".");
             if (dotIndex != -1) {
                 String fileExt = location.substring(dotIndex).toLowerCase(Locale.ENGLISH);



More information about the Android mailing list