Commit ec6c8366 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

upnp: Do not add the same element more than once

parent 3447e875
...@@ -767,14 +767,11 @@ bool MediaServer::fetchContents() ...@@ -767,14 +767,11 @@ bool MediaServer::fetchContents()
/* Try to extract all resources in DIDL */ /* Try to extract all resources in DIDL */
IXML_NodeList* p_resource_list = ixmlDocument_getElementsByTagName( (IXML_Document*) itemElement, "res" ); IXML_NodeList* p_resource_list = ixmlDocument_getElementsByTagName( (IXML_Document*) itemElement, "res" );
if ( p_resource_list ) if ( p_resource_list && ixmlNodeList_length( p_resource_list ) > 0 )
{
int i_length = ixmlNodeList_length( p_resource_list );
for ( int i = 0; i < i_length; i++ )
{ {
mtime_t i_duration = -1; mtime_t i_duration = -1;
int i_hours, i_minutes, i_seconds; int i_hours, i_minutes, i_seconds;
IXML_Element* p_resource = ( IXML_Element* ) ixmlNodeList_item( p_resource_list, i ); IXML_Element* p_resource = ( IXML_Element* ) ixmlNodeList_item( p_resource_list, 0 );
const char* psz_resource_url = xml_getChildElementValue( p_resource, "res" ); const char* psz_resource_url = xml_getChildElementValue( p_resource, "res" );
if( !psz_resource_url ) if( !psz_resource_url )
continue; continue;
...@@ -793,9 +790,6 @@ bool MediaServer::fetchContents() ...@@ -793,9 +790,6 @@ bool MediaServer::fetchContents()
} }
ixmlNodeList_free( p_resource_list ); ixmlNodeList_free( p_resource_list );
} }
else
continue;
}
ixmlNodeList_free( itemNodeList ); ixmlNodeList_free( itemNodeList );
} }
......
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