Commit d20d0224 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

UPnP CyberLink: do not spawn a useless poll thread (untested)

parent 64052e01
......@@ -68,35 +68,6 @@ vlc_module_begin();
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
*****************************************************************************
......@@ -145,24 +116,35 @@ class UPnPHandler : public MediaPlayer, public DeviceChangeListener,
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( vlc_object_alive (p_sd) )
{
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" );
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment