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

upnp: getNextItem: Cosmetics

parent a1efb1a9
...@@ -718,7 +718,7 @@ input_item_t* MediaServer::newItem( const char *objectID, const char *title ) ...@@ -718,7 +718,7 @@ input_item_t* MediaServer::newItem( const char *objectID, const char *title )
return p_item; return p_item;
} }
input_item_t* MediaServer::newItem(const char* title, const char*, const char*, input_item_t* MediaServer::newItem(const char* title, const char*,
mtime_t duration, const char* psz_url) mtime_t duration, const char* psz_url)
{ {
return input_item_NewWithTypeExt( psz_url, title, 0, NULL, 0, return input_item_NewWithTypeExt( psz_url, title, 0, NULL, 0,
...@@ -910,35 +910,26 @@ input_item_t* MediaServer::getNextItem() ...@@ -910,35 +910,26 @@ input_item_t* MediaServer::getNextItem()
if( itemNodeList_ ) if( itemNodeList_ )
{ {
for ( ; !p_item && itemNodeIndex_ < ixmlNodeList_length( itemNodeList_ ) for ( ; !p_item && itemNodeIndex_ < ixmlNodeList_length( itemNodeList_ ) ; itemNodeIndex_++ )
; itemNodeIndex_++ )
{ {
IXML_Element* itemElement = IXML_Element* itemElement = ( IXML_Element* )ixmlNodeList_item( itemNodeList_,
( IXML_Element* )ixmlNodeList_item( itemNodeList_, itemNodeIndex_ );
itemNodeIndex_ );
const char* objectID =
ixmlElement_getAttribute( itemElement, "id" );
const char* objectID = ixmlElement_getAttribute( itemElement, "id" );
if ( !objectID ) if ( !objectID )
continue; continue;
const char* title = const char* title = xml_getChildElementValue( itemElement, "dc:title" );
xml_getChildElementValue( itemElement, "dc:title" );
if ( !title ) if ( !title )
continue; continue;
const char* psz_subtitles = xml_getChildElementValue( itemElement, const char* psz_subtitles = xml_getChildElementValue( itemElement, "sec:CaptionInfo" );
"sec:CaptionInfo" );
if ( !psz_subtitles ) if ( !psz_subtitles )
psz_subtitles = xml_getChildElementValue( itemElement, psz_subtitles = xml_getChildElementValue( itemElement, "sec:CaptionInfoEx" );
"sec:CaptionInfoEx" );
if ( !psz_subtitles ) if ( !psz_subtitles )
psz_subtitles = xml_getChildElementValue( itemElement, psz_subtitles = xml_getChildElementValue( itemElement, "pv:subtitlefile" );
"pv:subtitlefile" );
/* 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" );
...@@ -954,14 +945,13 @@ input_item_t* MediaServer::getNextItem() ...@@ -954,14 +945,13 @@ input_item_t* MediaServer::getNextItem()
if ( psz_duration ) if ( psz_duration )
{ {
int i_hours, i_minutes, i_seconds; int i_hours, i_minutes, i_seconds;
if( sscanf( psz_duration, "%d:%02d:%02d", if( sscanf( psz_duration, "%d:%02d:%02d", &i_hours, &i_minutes, &i_seconds ) )
&i_hours, &i_minutes, &i_seconds ) ) i_duration = INT64_C(1000000) * ( i_hours * 3600 +
i_duration = INT64_C(1000000) * ( i_hours*3600 + i_minutes * 60 +
i_minutes*60 +
i_seconds ); i_seconds );
} }
p_item = newItem( title, objectID, psz_subtitles, i_duration, p_item = newItem( title, objectID, i_duration,
psz_resource_url ); psz_resource_url );
} }
ixmlNodeList_free( p_resource_list ); ixmlNodeList_free( p_resource_list );
......
...@@ -147,7 +147,7 @@ private: ...@@ -147,7 +147,7 @@ private:
void fetchContents(); void fetchContents();
input_item_t* newItem(const char* objectID, const char* title); input_item_t* newItem(const char* objectID, const char* title);
input_item_t* newItem(const char* title, const char* psz_objectID, const char* psz_subtitles, mtime_t duration, const char* psz_url ); input_item_t* newItem(const char* title, const char* psz_objectID, mtime_t duration, const char* psz_url );
IXML_Document* _browseAction(const char*, const char*, IXML_Document* _browseAction(const char*, const char*,
const char*, const char*, const char* ); const char*, const char*, const char* );
......
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