[vlc-commits] medialibrary: Properly encode path as mrl
Hugo Beauzée-Luyssen
git at videolan.org
Thu Aug 30 15:23:22 CEST 2018
vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Wed Aug 29 18:02:43 2018 +0200| [6e10455d0956fda52214f2c260af8a8e4563b4dd] | committer: Hugo Beauzée-Luyssen
medialibrary: Properly encode path as mrl
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=6e10455d0956fda52214f2c260af8a8e4563b4dd
---
modules/misc/medialibrary/medialib.cpp | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/modules/misc/medialibrary/medialib.cpp b/modules/misc/medialibrary/medialib.cpp
index 86652a32ec..3c90327633 100644
--- a/modules/misc/medialibrary/medialib.cpp
+++ b/modules/misc/medialibrary/medialib.cpp
@@ -24,6 +24,7 @@
#include <vlc_common.h>
#include <vlc_plugin.h>
+#include <vlc_url.h>
#include <vlc_media_library.h>
#include "medialibrary.h"
@@ -336,10 +337,9 @@ bool MediaLibrary::Start()
auto folder = vlc::wrap_cptr( config_GetUserDir( target ) );
if( folder == nullptr )
continue;
-
- auto mrl = std::string{ "file://" } + folder.get();
- ml->discover( mrl );
- varValue += ";" + mrl;
+ auto folderMrl = vlc::wrap_cptr( vlc_path2uri( folder.get(), nullptr ) );
+ ml->discover( folderMrl.get() );
+ varValue += std::string{ ";" } + folderMrl.get();
}
if ( varValue.empty() == false )
config_PutPsz( "ml-folders", varValue.c_str()+1 ); /* skip initial ';' */
More information about the vlc-commits
mailing list