[vlc-devel] [RFC PATCH 6/8] dsm: add "smb://" if not present

Thomas Guillem thomas at gllm.fr
Thu Nov 27 12:00:16 CET 2014


---
 modules/access/dsm/common.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/modules/access/dsm/common.c b/modules/access/dsm/common.c
index 5fb36ad..4212a56 100644
--- a/modules/access/dsm/common.c
+++ b/modules/access/dsm/common.c
@@ -455,10 +455,17 @@ static int add_item( bdsm_sys_t *p_sys, bdsm_item_cb_t *p_cb,
                     const char *psz_parent_uri, const char *psz_name )
 {
     input_item_t *p_item;
+    const char   *psz_prefix;
     char         *psz_uri, *psz_option;
     int           i_ret;
 
-    i_ret = asprintf( &psz_uri, "%s/%s", psz_parent_uri, psz_name );
+    if( strncmp( psz_parent_uri, "smb://", strlen("smb://") ) == 0 )
+        psz_prefix = "";
+    else
+        psz_prefix = "smb://";
+
+    i_ret = asprintf( &psz_uri, "%s%s/%s", psz_prefix,
+                      psz_parent_uri, psz_name );
     if( i_ret == -1 )
         return VLC_ENOMEM;
 
-- 
2.1.3




More information about the vlc-devel mailing list