[vlc-devel] [PATCH 11/14] dsm: add "smb://" if not present

Thomas Guillem thomas at gllm.fr
Fri Dec 5 14:43:02 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 34aa8d8..1256d40 100644
--- a/modules/access/dsm/common.c
+++ b/modules/access/dsm/common.c
@@ -512,10 +512,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