[vlc-devel] [PATCH v3 4/4] smb2: support browsing files when running on a non standard port

Pierre Lamot pierre at videolabs.io
Fri May 29 10:57:02 CEST 2020


---
 modules/access/smb2.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/modules/access/smb2.c b/modules/access/smb2.c
index c98c66a857..5e73d3a7cc 100644
--- a/modules/access/smb2.c
+++ b/modules/access/smb2.c
@@ -323,7 +323,7 @@ FileControl(stream_t *access, int i_query, va_list args)
 static char *
 vlc_smb2_get_url(vlc_url_t *url, const char *file)
 {
-    /* smb2://<psz_host><psz_path><file>?<psz_option> */
+    /* smb2://<psz_host><i_port><psz_path><file>?<psz_option> */
     struct vlc_memstream buf;
     vlc_memstream_open(&buf);
     if (strchr(url->psz_host, ':') != NULL)
@@ -331,6 +331,9 @@ vlc_smb2_get_url(vlc_url_t *url, const char *file)
     else
         vlc_memstream_printf(&buf, "smb://%s", url->psz_host);
 
+    if (url->i_port != 0)
+        vlc_memstream_printf(&buf, ":%d", url->i_port);
+
     if (url->psz_path != NULL)
     {
         vlc_memstream_puts(&buf, url->psz_path);
-- 
2.25.1



More information about the vlc-devel mailing list