[vlc-commits] commit: mediadirs: ensure uri-encoded path is passed to vlc core ( Erwan Tulou )

git at videolan.org git at videolan.org
Mon May 17 18:02:26 CEST 2010


vlc | branch: master | Erwan Tulou <erwan10 at videolan.org> | Tue May 11 11:15:01 2010 +0200| [440435aecfa98b551d0d0a1753a32adda9c93cdc] | committer: Erwan Tulou 

mediadirs: ensure uri-encoded path is passed to vlc core

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

 modules/services_discovery/mediadirs.c |   10 +++-------
 1 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/modules/services_discovery/mediadirs.c b/modules/services_discovery/mediadirs.c
index 9f91151..5c0cd90 100644
--- a/modules/services_discovery/mediadirs.c
+++ b/modules/services_discovery/mediadirs.c
@@ -258,6 +258,8 @@ static void input_item_subitem_added( const vlc_event_t * p_event,
 static int onNewFileAdded( vlc_object_t *p_this, char const *psz_var,
                      vlc_value_t oldval, vlc_value_t newval, void *p_data )
 {
+    (void)p_this;
+
     services_discovery_t *p_sd = p_data;
     services_discovery_sys_t *p_sys = p_sd->p_sys;
 
@@ -310,7 +312,6 @@ void formatSnapshotItem( input_item_t *p_item )
     if( !p_item )
         return;
 
-    char* psz_file = NULL;
     char* psz_option = NULL;
     char* psz_uri = input_item_GetURI( p_item );
 
@@ -320,11 +321,7 @@ void formatSnapshotItem( input_item_t *p_item )
     /* copy the snapshot mrl as a ArtURL */
     input_item_SetArtURL( p_item, psz_uri );
 
-    psz_file = make_path( psz_uri );
-    if( !psz_file )
-        goto end;
-
-    if( asprintf( &psz_option, "fake-file=%s", psz_file ) == -1 )
+    if( asprintf( &psz_option, "fake-file=%s", psz_uri ) == -1 )
     {
         psz_option = NULL;
         goto end;
@@ -336,7 +333,6 @@ void formatSnapshotItem( input_item_t *p_item )
 
 end:
     free( psz_option );
-    free( psz_file );
     free( psz_uri );
 }
 



More information about the vlc-commits mailing list