[vlc-devel] [RFC PATCH 3/7] upnp: change item i_type and i_browsable

Thomas Guillem thomas at gllm.fr
Fri Mar 20 17:38:34 CET 2015


All items are ITEM_TYPE_NET, set i_browsable if the item is a share of a
directory.
---
 modules/services_discovery/upnp.cpp | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/modules/services_discovery/upnp.cpp b/modules/services_discovery/upnp.cpp
index b427cf7..7ef16f1 100644
--- a/modules/services_discovery/upnp.cpp
+++ b/modules/services_discovery/upnp.cpp
@@ -278,8 +278,9 @@ bool MediaServerList::addServer( MediaServerDesc* desc )
     if( asprintf(&psz_mrl, "upnp://%s?ObjectID=%s", desc->location.c_str(), desc->UDN.c_str() ) < 0 )
         return false;
 
-    p_input_item = input_item_NewWithType( psz_mrl, desc->friendlyName.c_str(), 0,
-                                           NULL, 0, -1, ITEM_TYPE_NODE );
+    p_input_item = input_item_NewWithTypeExt( psz_mrl, desc->friendlyName.c_str(), 0,
+                                              NULL, 0, -1, ITEM_TYPE_NODE,
+                                              ITEM_BROWSABLE);
     free( psz_mrl );
     if ( !p_input_item )
         return false;
@@ -549,8 +550,9 @@ void MediaServer::addItem(const char *objectID, const char *title )
     }
     vlc_UrlClean( &url );
 
-    input_item_t* p_item = input_item_NewWithType( psz_url, title, 0, NULL,
-                                                   0, -1, ITEM_TYPE_NODE );
+    input_item_t* p_item = input_item_NewWithTypeExt( psz_url, title, 0, NULL,
+                                                      0, -1, ITEM_TYPE_NET,
+                                                      ITEM_BROWSABLE );
     free( psz_url);
     if ( !p_item )
         return;
-- 
2.1.3




More information about the vlc-devel mailing list