]> git.sesse.net Git - vlc/blobdiff - modules/services_discovery/upnp_cc.cpp
various modules: adjust to new playlist design
[vlc] / modules / services_discovery / upnp_cc.cpp
index 209225c80a6113643f06e58d78603ac3a50396fd..7b72db632e3042299893578a31b781a7ed4e23eb 100644 (file)
@@ -39,6 +39,7 @@
 #include <vlc_common.h>
 #include <vlc_plugin.h>
 #include <vlc_playlist.h>
+#include <vlc_services_discovery.h>
 
 /* FIXME: thread-safety ?? */
 /* FIXME: playlist locking */
@@ -57,16 +58,20 @@ using namespace CyberLink;
     static int  Open ( vlc_object_t * );
     static void Close( vlc_object_t * );
 
-vlc_module_begin();
-    set_shortname( "UPnP");
-    set_description( N_("Universal Plug'n'Play discovery") );
-    set_category( CAT_PLAYLIST );
-    set_subcategory( SUBCAT_PLAYLIST_SD );
+VLC_SD_PROBE_HELPER("upnp", N_("Universal Plug'n'Play"))
 
-    set_capability( "services_discovery", 0 );
-    set_callbacks( Open, Close );
+vlc_module_begin ()
+    set_shortname( "UPnP")
+    set_description( N_("Universal Plug'n'Play") )
+    set_category( CAT_PLAYLIST )
+    set_subcategory( SUBCAT_PLAYLIST_SD )
 
-vlc_module_end();
+    set_capability( "services_discovery", 0 )
+    set_callbacks( Open, Close )
+
+    VLC_SD_PROBE_SUBMODULE
+
+vlc_module_end ()
 
 /*****************************************************************************
  * Run: main UPnP thread
@@ -125,8 +130,6 @@ static int Open( vlc_object_t *p_this )
 {
     services_discovery_t *p_sd = ( services_discovery_t* )p_this;
 
-    services_discovery_SetLocalizedName( p_sd, _("Devices") );
-
     UPnPHandler *u = new UPnPHandler( p_sd );
     u->start( );
     msg_Dbg( p_sd, "upnp discovery started" );
@@ -201,8 +204,8 @@ void UPnPHandler::AddContent( playlist_item_t *p_parent, ContentNode *node )
         ItemNode *iNode = (ItemNode *)node;
         input_item_t *p_input = input_item_New( p_sd, iNode->getResource(), title );
         /* FIXME: playlist_AddInput() can fail */
-        playlist_BothAddInput( p_playlist, p_input, p_parent,
-                               PLAYLIST_APPEND, PLAYLIST_END, NULL, NULL,
+        playlist_NodeAddInput( p_playlist, p_input, p_parent,
+                               PLAYLIST_APPEND, PLAYLIST_END,
                                false );
         vlc_gc_decref( p_input );
     } else if ( node->isContainerNode() )