[vlc-commits] upnp: getNextItem: Cosmetics

Hugo Beauzée-Luyssen git at videolan.org
Thu Jan 28 13:11:36 CET 2016


vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Thu Jan 28 12:36:00 2016 +0100| [a5b3733325a0f20f40c7748f881be78194e3a1fd] | committer: Hugo Beauzée-Luyssen

upnp: getNextItem: Cosmetics

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a5b3733325a0f20f40c7748f881be78194e3a1fd
---

 modules/services_discovery/upnp.cpp |   36 +++++++++++++----------------------
 modules/services_discovery/upnp.hpp |    2 +-
 2 files changed, 14 insertions(+), 24 deletions(-)

diff --git a/modules/services_discovery/upnp.cpp b/modules/services_discovery/upnp.cpp
index 6d78945..94ebfcf 100644
--- a/modules/services_discovery/upnp.cpp
+++ b/modules/services_discovery/upnp.cpp
@@ -718,7 +718,7 @@ input_item_t* MediaServer::newItem( const char *objectID, const char *title )
     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)
 {
     return input_item_NewWithTypeExt( psz_url, title, 0, NULL, 0,
@@ -910,35 +910,26 @@ input_item_t* MediaServer::getNextItem()
 
     if( itemNodeList_ )
     {
-        for ( ; !p_item && itemNodeIndex_ < ixmlNodeList_length( itemNodeList_ )
-              ; itemNodeIndex_++ )
+        for ( ; !p_item && itemNodeIndex_ < ixmlNodeList_length( itemNodeList_ ) ; itemNodeIndex_++ )
         {
-            IXML_Element* itemElement =
-                        ( IXML_Element* )ixmlNodeList_item( itemNodeList_,
-                                                            itemNodeIndex_ );
-
-            const char* objectID =
-                        ixmlElement_getAttribute( itemElement, "id" );
+            IXML_Element* itemElement = ( IXML_Element* )ixmlNodeList_item( itemNodeList_,
+                                                                            itemNodeIndex_ );
 
+            const char* objectID = ixmlElement_getAttribute( itemElement, "id" );
             if ( !objectID )
                 continue;
 
-            const char* title =
-                        xml_getChildElementValue( itemElement, "dc:title" );
-
+            const char* title = xml_getChildElementValue( itemElement, "dc:title" );
             if ( !title )
                 continue;
 
-            const char* psz_subtitles = xml_getChildElementValue( itemElement,
-                    "sec:CaptionInfo" );
+            const char* psz_subtitles = xml_getChildElementValue( itemElement, "sec:CaptionInfo" );
 
             if ( !psz_subtitles )
-                psz_subtitles = xml_getChildElementValue( itemElement,
-                        "sec:CaptionInfoEx" );
+                psz_subtitles = xml_getChildElementValue( itemElement, "sec:CaptionInfoEx" );
 
             if ( !psz_subtitles )
-                psz_subtitles = xml_getChildElementValue( itemElement,
-                        "pv:subtitlefile" );
+                psz_subtitles = xml_getChildElementValue( itemElement, "pv:subtitlefile" );
 
             /* Try to extract all resources in DIDL */
             IXML_NodeList* p_resource_list = ixmlDocument_getElementsByTagName( (IXML_Document*) itemElement, "res" );
@@ -954,14 +945,13 @@ input_item_t* MediaServer::getNextItem()
                 if ( psz_duration )
                 {
                     int i_hours, i_minutes, i_seconds;
-                    if( sscanf( psz_duration, "%d:%02d:%02d",
-                        &i_hours, &i_minutes, &i_seconds ) )
-                        i_duration = INT64_C(1000000) * ( i_hours*3600 +
-                                                          i_minutes*60 +
+                    if( sscanf( psz_duration, "%d:%02d:%02d", &i_hours, &i_minutes, &i_seconds ) )
+                        i_duration = INT64_C(1000000) * ( i_hours * 3600 +
+                                                          i_minutes * 60 +
                                                           i_seconds );
                 }
 
-                p_item = newItem( title, objectID, psz_subtitles, i_duration,
+                p_item = newItem( title, objectID, i_duration,
                                   psz_resource_url );
             }
             ixmlNodeList_free( p_resource_list );
diff --git a/modules/services_discovery/upnp.hpp b/modules/services_discovery/upnp.hpp
index e401a00..0cdbd8d 100644
--- a/modules/services_discovery/upnp.hpp
+++ b/modules/services_discovery/upnp.hpp
@@ -147,7 +147,7 @@ private:
 
     void fetchContents();
     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*,
             const char*, const char*, const char* );



More information about the vlc-commits mailing list