[Android] Playback: Enforce mrl encoding

Geoffrey Métais git at videolan.org
Mon Dec 10 15:48:26 CET 2018


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Dec 10 15:45:55 2018 +0100| [a26231576a05e3c79fb68e80230e696d438beaac] | committer: Geoffrey Métais

Playback: Enforce mrl encoding

Fix playback of file containing '?' in their name

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

 vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt b/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt
index e7f9a5b1f..cdd6efc7d 100644
--- a/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt
+++ b/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt
@@ -17,6 +17,7 @@ import org.videolan.libvlc.MediaPlayer
 import org.videolan.libvlc.RendererItem
 import org.videolan.libvlc.util.AndroidUtil
 import org.videolan.medialibrary.Medialibrary
+import org.videolan.medialibrary.Tools
 import org.videolan.medialibrary.media.MediaWrapper
 import org.videolan.vlc.BuildConfig
 import org.videolan.vlc.PlaybackService
@@ -287,7 +288,7 @@ class PlaylistManager(val service: PlaybackService) : MediaWrapperList.EventList
                 return
             }
             val start = getStartTime(mw)
-            val media = Media(VLCInstance.get(), Uri.parse(Uri.decode(uri.toString())))
+            val media = Media(VLCInstance.get(), Uri.parse(Tools.encodeVLCString(uri.toString())))
             media.addOption(":start-time=$start")
             VLCOptions.setMediaOptions(media, ctx, flags or mw.flags)
             /* keeping only video during benchmark */



More information about the Android mailing list