]> git.sesse.net Git - vlc/commitdiff
skins2: ensure uri-encoded paths are passed to vlc core
authorErwan Tulou <erwan10@videolan.org>
Tue, 11 May 2010 09:00:43 +0000 (11:00 +0200)
committerErwan Tulou <erwan10@videolan.org>
Mon, 17 May 2010 15:54:38 +0000 (17:54 +0200)
modules/gui/skins2/parser/xmlparser.cpp
modules/gui/skins2/src/file_bitmap.cpp

index dd7279b9b00017680c11ad84d3c6dc9d80a7b919..b00ee27b622b1dd4b0393b3a8f74efc9ecbbd415 100644 (file)
@@ -23,6 +23,7 @@
 
 #include "xmlparser.hpp"
 #include "../src/os_factory.hpp"
+#include <vlc_url.h>
 
 #ifdef HAVE_SYS_STAT_H
 #   include <sys/stat.h>
@@ -54,7 +55,10 @@ XMLParser::XMLParser( intf_thread_t *pIntf, const string &rFileName,
     // }
     LoadCatalog();
 
-    m_pStream = stream_UrlNew( pIntf, rFileName.c_str() );
+    char* psz_uri = make_URI( rFileName.c_str() );
+    m_pStream = stream_UrlNew( pIntf, psz_uri );
+    free( psz_uri );
+
     if( !m_pStream )
     {
         msg_Err( getIntf(), "failed to open %s for reading",
index bcefa7bae8553e0b26b3dcd9105f262e4e0256aa..00bf4f41fe7d73bcbce5d04d06d4359ac75581db 100644 (file)
@@ -28,6 +28,7 @@
 
 #include <vlc_common.h>
 #include <vlc_image.h>
+#include <vlc_url.h>
 #include "file_bitmap.hpp"
 
 FileBitmap::FileBitmap( intf_thread_t *pIntf, image_handler_t *pImageHandler,
@@ -41,8 +42,12 @@ FileBitmap::FileBitmap( intf_thread_t *pIntf, image_handler_t *pImageHandler,
 
     fmt_out.i_chroma = VLC_CODEC_RGBA;
 
-    pPic = image_ReadUrl( pImageHandler, fileName.c_str(), &fmt_in, &fmt_out );
-    if( !pPic ) return;
+    char* psz_uri = make_URI( fileName.c_str() );
+    pPic = image_ReadUrl( pImageHandler, psz_uri, &fmt_in, &fmt_out );
+    free( psz_uri );
+
+    if( !pPic )
+        return;
 
     m_width = fmt_out.i_width;
     m_height = fmt_out.i_height;