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

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


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

Try with media name if last Uri segment is empty

(cherry picked from commit 5def9286497d47711a62f1ba497ad171948d1c91)

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

 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