[Android] Try with media name if last Uri segment is empty

Geoffrey Métais git at videolan.org
Wed Aug 10 12:23:07 CEST 2016


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Aug 10 12:22:15 2016 +0200| [5def9286497d47711a62f1ba497ad171948d1c91] | committer: Geoffrey Métais

Try with media name if last Uri segment is empty

> https://code.videolan.org/videolan/vlc-android/commit/5def9286497d47711a62f1ba497ad171948d1c91
---

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

diff --git a/vlc-android/src/org/videolan/vlc/media/MediaWrapper.java b/vlc-android/src/org/videolan/vlc/media/MediaWrapper.java
index 90efbcd..5466e90 100644
--- a/vlc-android/src/org/videolan/vlc/media/MediaWrapper.java
+++ b/vlc-android/src/org/videolan/vlc/media/MediaWrapper.java
@@ -162,7 +162,9 @@ public class MediaWrapper implements Parcelable {
             return;
 
         String fileExt = null, filename = mUri.getLastPathSegment();
-        if (filename == null)
+        if (TextUtils.isEmpty(filename))
+            filename = mTitle;
+        if (TextUtils.isEmpty(filename))
             return;
         final int index = filename.indexOf('?');
         if (index != -1)



More information about the Android mailing list