[Android] Fix loading of last playlist

Geoffrey Métais git at videolan.org
Fri Dec 22 14:07:17 CET 2017


vlc-android | branch: 2.5.x | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Dec 22 14:00:46 2017 +0100| [4e9c655f398727fc6d32a537775a0ff297614a4b] | committer: Geoffrey Métais

Fix loading of last playlist

Media were not correctly retrieved from medialibrary

(cherry picked from commit 251be4668ab356bb6f2783045ac4dca2f74af25e)

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

 vlc-android/src/org/videolan/vlc/PlaybackService.java | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/PlaybackService.java b/vlc-android/src/org/videolan/vlc/PlaybackService.java
index 29b363b17..e5271fdb0 100644
--- a/vlc-android/src/org/videolan/vlc/PlaybackService.java
+++ b/vlc-android/src/org/videolan/vlc/PlaybackService.java
@@ -1667,9 +1667,8 @@ public class PlaybackService extends MediaBrowserServiceCompat implements IVLCVo
 
                 final List<MediaWrapper> playList = new ArrayList<>(locations.length);
                 for (String location : locations) {
-                    String mrl = Uri.decode(location);
-                    MediaWrapper mw = mMedialibrary.getMedia(mrl);
-                    if (mw == null) mw = new MediaWrapper(Uri.parse(mrl));
+                    final String mrl = Uri.decode(location);
+                    final MediaWrapper mw = mMedialibrary.findMedia(new MediaWrapper(Uri.parse(mrl)));
                     playList.add(mw);
                 }
                 // load playlist



More information about the Android mailing list