case UPNP_EVENT_SUBSCRIBE_COMPLETE:
msg_Warn( p_sd, "subscription complete" );
break;
-
+
case UPNP_DISCOVERY_SEARCH_TIMEOUT:
msg_Warn( p_sd, "search timeout" );
break;
-
+
default:
msg_Dbg( p_sd,
"%s:%d: DEBUG: UNHANDLED EVENT ( TYPE=%d )",
services_discovery_t* p_sd )
{
if ( !doc )
- {
- msg_Dbg( p_sd, "%s:%d: NULL", __FILE__, __LINE__ );
+ {
+ msg_Dbg( p_sd, "%s:%d: NULL", __FILE__, __LINE__ );
return;
}
-
+
if ( !location )
{
- msg_Dbg( p_sd, "%s:%d: NULL", __FILE__, __LINE__ );
+ msg_Dbg( p_sd, "%s:%d: NULL", __FILE__, __LINE__ );
return;
}
IXML_NodeList* deviceList =
ixmlDocument_getElementsByTagName( doc, "device" );
-
+
if ( deviceList )
{
for ( unsigned int i = 0; i < ixmlNodeList_length( deviceList ); i++ )
__FILE__, __LINE__ );
continue;
}
-
+
if ( p_sd->p_sys->serverList->getServer( UDN ) != 0 )
continue;
const char* friendlyName =
- xml_getChildElementValue( deviceElement,
+ xml_getChildElementValue( deviceElement,
"friendlyName" );
-
+
if ( !friendlyName )
{
msg_Dbg( p_sd, "%s:%d: no friendlyName!", __FILE__, __LINE__ );
}
MediaServer* server = new MediaServer( UDN, friendlyName, p_sd );
-
+
if ( !p_sd->p_sys->serverList->addServer( server ) )
{
IXML_Document* action = 0;
IXML_Document* response = 0;
const char* url = getContentDirectoryControlURL();
-
+
if ( !url || strcmp( url, "" ) == 0 )
{
msg_Dbg( _p_sd, "No subscription url set!" );
res = UpnpAddToAction( &action, "Browse",
serviceType, "ObjectID", ObjectID );
-
- if ( res != UPNP_E_SUCCESS )
+
+ if ( res != UPNP_E_SUCCESS )
{
msg_Dbg( _p_sd,
"%s:%d: ERROR: %s", __FILE__, __LINE__,
res = UpnpAddToAction( &action, "Browse",
serviceType, "BrowseFlag", BrowseFlag );
-
+
if ( res != UPNP_E_SUCCESS )
{
msg_Dbg( _p_sd,
res = UpnpAddToAction( &action, "Browse",
serviceType, "Filter", Filter );
-
+
if ( res != UPNP_E_SUCCESS )
{
msg_Dbg( _p_sd,
res = UpnpAddToAction( &action, "Browse",
serviceType, "SortCriteria", SortCriteria );
-
+
if ( res != UPNP_E_SUCCESS )
{
msg_Dbg( _p_sd,
0,
action,
&response );
-
+
if ( res != UPNP_E_SUCCESS )
{
msg_Dbg( _p_sd,
IXML_Document* result = parseBrowseResult( response );
ixmlDocument_free( response );
-
+
if ( !result )
{
msg_Dbg( _p_sd,
IXML_NodeList* containerNodeList =
ixmlDocument_getElementsByTagName( result, "container" );
-
+
if ( containerNodeList )
{
for ( unsigned int i = 0;
const char* childCountStr =
ixmlElement_getAttribute( containerElement, "childCount" );
-
+
if ( !childCountStr )
continue;
-
+
int childCount = atoi( childCountStr );
const char* title = xml_getChildElementValue( containerElement,
"dc:title" );
-
+
if ( !title )
continue;
-
+
const char* resource = xml_getChildElementValue( containerElement,
"res" );
const char* objectID =
ixmlElement_getAttribute( itemElement, "id" );
-
+
if ( !objectID )
continue;
const char* title =
xml_getChildElementValue( itemElement, "dc:title" );
-
+
if ( !title )
continue;
const char* resource =
xml_getChildElementValue( itemElement, "res" );
-
+
if ( !resource )
continue;
services_discovery_t* p_sd = _p_sd;
- p_input_item = input_item_New( p_sd, "vlc://nop", s->getFriendlyName() );
+ p_input_item = input_item_New( p_sd, "vlc://nop", s->getFriendlyName() );
s->setInputItem( p_input_item );
services_discovery_AddItem( p_sd, p_input_item, NULL );