[Android] Set type Playlist on init from Media

Geoffrey Métais git at videolan.org
Fri May 27 16:42:33 CEST 2016


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri May 27 16:08:29 2016 +0200| [ed5c4d0423532ea597e205c8271598493ff809e0] | committer: Geoffrey Métais

Set type Playlist on init from Media

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

 vlc-android/src/org/videolan/vlc/media/MediaWrapper.java | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/media/MediaWrapper.java b/vlc-android/src/org/videolan/vlc/media/MediaWrapper.java
index 55073dc..404de8b 100644
--- a/vlc-android/src/org/videolan/vlc/media/MediaWrapper.java
+++ b/vlc-android/src/org/videolan/vlc/media/MediaWrapper.java
@@ -141,8 +141,15 @@ public class MediaWrapper implements Parcelable {
                 }
             }
             updateMeta(media);
-            if (mType == TYPE_ALL && media.getType() == Media.Type.Directory)
-                mType = TYPE_DIR;
+            if (mType == TYPE_ALL)
+                switch (media.getType()) {
+                    case Media.Type.Directory:
+                        mType = TYPE_DIR;
+                        break;
+                    case Media.Type.Playlist:
+                        mType = TYPE_PLAYLIST;
+                        break;
+                }
             mSlaves = media.getSlaves();
         }
         defineType();



More information about the Android mailing list