[vlc-devel] [PATCHv3 09/12] microdns: if we have a port use it, regardless of the default value

Thomas Guillem thomas at gllm.fr
Tue Mar 29 15:06:40 CEST 2016


From: Steve Lhomme <robux4 at videolabs.io>

---
 modules/services_discovery/microdns.c | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/modules/services_discovery/microdns.c b/modules/services_discovery/microdns.c
index 7ab5ea5..d917146 100644
--- a/modules/services_discovery/microdns.c
+++ b/modules/services_discovery/microdns.c
@@ -95,16 +95,15 @@ static const struct
 {
     const char *psz_protocol;
     const char *psz_service_name;
-    uint16_t    i_default_port;
     bool        b_renderer;
     int         i_renderer_flags;
 } protocols[] = {
-    { "ftp", "_ftp._tcp.local", 21, false, 0 },
-    { "smb", "_smb._tcp.local", 445, false, 0 },
-    { "nfs", "_nfs._tcp.local", 2049, false, 0 },
-    { "sftp", "_sftp-ssh._tcp.local", 22, false, 0 },
-    { "rtsp", "_rtsp._tcp.local", 554, false, 0 },
-    { "chromecast", "_googlecast._tcp.local", 8009, true, VLC_RENDERER_CAN_AUDIO },
+    { "ftp", "_ftp._tcp.local", false, 0 },
+    { "smb", "_smb._tcp.local", false, 0 },
+    { "nfs", "_nfs._tcp.local", false, 0 },
+    { "sftp", "_sftp-ssh._tcp.local", false, 0 },
+    { "rtsp", "_rtsp._tcp.local", false, 0 },
+    { "chromecast", "_googlecast._tcp.local", true, VLC_RENDERER_CAN_AUDIO },
 };
 #define NB_PROTOCOLS (sizeof(protocols) / sizeof(*protocols))
 
@@ -345,8 +344,7 @@ new_entries_cb( void *p_this, int i_status,
                     if( p_srv->psz_device_name == NULL )
                         break;
                     p_srv->psz_protocol = protocols[i].psz_protocol;
-                    if( protocols[i].i_default_port != p_entry->data.SRV.port )
-                        p_srv->i_port = p_entry->data.SRV.port;
+                    p_srv->i_port = p_entry->data.SRV.port;
                     p_srv->b_renderer = protocols[i].b_renderer;
                     p_srv->i_renderer_flags = protocols[i].i_renderer_flags;
                     ++i_srv_idx;
-- 
2.8.0.rc3



More information about the vlc-devel mailing list