[Android] Fix the MediaWrapper constructor from IMedia uri encoding

Nicolas Pomepuy git at videolan.org
Tue Mar 14 11:59:20 UTC 2023


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Wed Feb 15 14:42:26 2023 +0100| [3480b86987444bfc6614734ae5090e7465e20261] | committer: Nicolas Pomepuy

Fix the MediaWrapper constructor from IMedia uri encoding

It is causing uri mismatches when comparing MediaWrapper coming from
the medialibrary and others coming from the file browser.

Fixes #2816

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

 .../src/org/videolan/medialibrary/interfaces/media/MediaWrapper.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/medialibrary/src/org/videolan/medialibrary/interfaces/media/MediaWrapper.java b/medialibrary/src/org/videolan/medialibrary/interfaces/media/MediaWrapper.java
index 6b54d477f0..73c4fd3c47 100644
--- a/medialibrary/src/org/videolan/medialibrary/interfaces/media/MediaWrapper.java
+++ b/medialibrary/src/org/videolan/medialibrary/interfaces/media/MediaWrapper.java
@@ -224,7 +224,7 @@ public abstract class MediaWrapper extends MediaLibraryItem implements Parcelabl
         if (media == null)
             throw new NullPointerException("media was null");
 
-        mUri = media.getUri();
+        mUri = Uri.parse(VLCUtil.encodeVLCUri(media.getUri()));
         init(media);
     }
 



More information about the Android mailing list