[vlc-devel] commit: Convert paths from command line arguments to URIs ( Rémi Denis-Courmont )

git version control git at videolan.org
Mon Oct 5 21:59:17 CEST 2009


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Oct  5 22:58:46 2009 +0300| [5655e629caf91f37cc6fc7aacaaab01b6d35a87c] | committer: Rémi Denis-Courmont 

Convert paths from command line arguments to URIs

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

 src/libvlc.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/libvlc.c b/src/libvlc.c
index 5d1b63e..a48e965 100644
--- a/src/libvlc.c
+++ b/src/libvlc.c
@@ -87,6 +87,7 @@
 
 #include <vlc_charset.h>
 #include <vlc_cpu.h>
+#include <vlc_url.h>
 
 #include "libvlc.h"
 
@@ -1305,13 +1306,16 @@ static int GetFilenames( libvlc_int_t *p_vlc, int i_argc, const char *ppsz_argv[
 
         /* TODO: write an internal function of this one, to avoid
          *       unnecessary lookups. */
+        char *mrl = make_URI( ppsz_argv[i_opt] );
+        if( !mrl )
+            continue;
 
         playlist_t *p_playlist = pl_Hold( p_vlc );
-        playlist_AddExt( p_playlist, ppsz_argv[i_opt], NULL, PLAYLIST_INSERT,
-                         0, -1,
-                         i_options, ( i_options ? &ppsz_argv[i_opt + 1] : NULL ), VLC_INPUT_OPTION_TRUSTED,
-                         true, pl_Unlocked );
+        playlist_AddExt( p_playlist, mrl, NULL, PLAYLIST_INSERT,
+                0, -1, i_options, ( i_options ? &ppsz_argv[i_opt + 1] : NULL ),
+                VLC_INPUT_OPTION_TRUSTED, true, pl_Unlocked );
         pl_Release( p_vlc );
+        free( mrl );
     }
 
     return VLC_SUCCESS;




More information about the vlc-devel mailing list