vlc_module_end();
-/*****************************************************************************
- * Local prototypes
- *****************************************************************************/
-
-/* Main functions */
- static void Run ( services_discovery_t *p_sd );
-
-/*****************************************************************************
- * Open: initialize and create stuff
- *****************************************************************************/
-static int Open( vlc_object_t *p_this )
-{
- services_discovery_t *p_sd = ( services_discovery_t* )p_this;
-
- p_sd->pf_run = Run;
-
- services_discovery_SetLocalizedName( p_sd, _("Devices") );
-
- return VLC_SUCCESS;
-}
-
-
-/*****************************************************************************
- * Close:
- *****************************************************************************/
-static void Close( vlc_object_t *p_this )
-{
-}
-
/*****************************************************************************
* Run: main UPnP thread
*****************************************************************************
addSearchResponseListener( this );
//addEventListener( this );
}
-
};
-static void Run( services_discovery_t *p_sd )
+/*****************************************************************************
+ * Open: initialize and create stuff
+ *****************************************************************************/
+static int Open( vlc_object_t *p_this )
{
- UPnPHandler u( p_sd );
+ services_discovery_t *p_sd = ( services_discovery_t* )p_this;
- u.start();
+ services_discovery_SetLocalizedName( p_sd, _("Devices") );
- msg_Dbg( p_sd, "UPnP discovery started" );
- /* read SAP packets */
- while( !p_sd->b_die )
- {
- msleep( 500 );
- }
+ UPnPHandler *u = new UPnPHandler( p_sd );
+ u->start( );
+ msg_Dbg( p_sd, "upnp discovery started" );
+ p_sd->p_private = u;
+
+ return VLC_SUCCESS;
+}
+
+
+/*****************************************************************************
+ * Close:
+ *****************************************************************************/
+static void Close( vlc_object_t *p_this )
+{
+ UPnPHandler *u = (UPnPHandler *)p_this->p_private;
+ u->stop( );
- u.stop();
- msg_Dbg( p_sd, "UPnP discovery stopped" );
+ msg_Dbg( p_this, "upnp discovery started" );
}
if ( node->isItemNode() )
{
ItemNode *iNode = (ItemNode *)node;
- input_item_t *p_input = input_ItemNew( p_sd, iNode->getResource(), title );
+ 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,