[vlc-commits] commit: skins2: ensure uri-encoded paths are passed to vlc core ( Erwan Tulou )

git at videolan.org git at videolan.org
Mon May 17 17:59:46 CEST 2010


vlc | branch: master | Erwan Tulou <erwan10 at videolan.org> | Tue May 11 11:00:43 2010 +0200| [58f63289c2a8720b6aef6c3ae365737ead8ec05b] | committer: Erwan Tulou 

skins2: ensure uri-encoded paths are passed to vlc core

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=58f63289c2a8720b6aef6c3ae365737ead8ec05b
---

 modules/gui/skins2/parser/xmlparser.cpp |    6 +++++-
 modules/gui/skins2/src/file_bitmap.cpp  |    9 +++++++--
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/modules/gui/skins2/parser/xmlparser.cpp b/modules/gui/skins2/parser/xmlparser.cpp
index dd7279b..b00ee27 100644
--- a/modules/gui/skins2/parser/xmlparser.cpp
+++ b/modules/gui/skins2/parser/xmlparser.cpp
@@ -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",
diff --git a/modules/gui/skins2/src/file_bitmap.cpp b/modules/gui/skins2/src/file_bitmap.cpp
index bcefa7b..00bf4f4 100644
--- a/modules/gui/skins2/src/file_bitmap.cpp
+++ b/modules/gui/skins2/src/file_bitmap.cpp
@@ -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;



More information about the vlc-commits mailing list