[vlc-devel] [PATCH 1/1] upnp: add every server-presented subtitle URL

sam_ at centrum.sk sam_ at centrum.sk
Mon Jan 22 23:25:23 CET 2018


Add slave for each subtitle URL, based on http://www.edavs.com/forum/viewtopic.php?f=4&t=52. Each URL will be present once as "slaves" is already a set. 
Removal of psz_subtitles checks is safe as addSlave() checks for NULL argument. Diff also here: https://github.com/samunders-core/vlc/pull/1/commits/776f39b9d1097e4d1cc02f150bcb3c585fdf3af3--- modules/services_discovery/upnp.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-)diff --git a/modules/services_discovery/upnp.cpp b/modules/services_discovery/upnp.cppindex 82d43632f47..35992968e76 100644--- a/modules/services_discovery/upnp.cpp+++ b/modules/services_discovery/upnp.cpp@@ -842,9 +842,20 @@ namespace             if ( !title )                 return false;             const char *psz_subtitles = xml_getChildElementValue( itemElement, "sec:CaptionInfo" );-            if ( !psz_subtitles &&-                 !(psz_subtitles = xml_getChildElementValue( itemElement, "sec:CaptionInfoEx" )) )-                psz_subtitles = xml_getChildElementValue( itemElement, "pv:subtitlefile" );+            addSlave(psz_subtitles, SLAVE_TYPE_SPU);+            int lis
 t_length
  = 0;+            IXML_NodeList* p_subtitle_list = ixmlDocument_getElementsByTagName(+                            (IXML_Document*) itemElement, "sec:CaptionInfoEx" );+            if (p_subtitle_list)+                list_length = ixmlNodeList_length( p_subtitle_list );+            for (int index = 0; index < list_length; index++)+            {+                IXML_Node* p_childNode = ixmlNodeList_item( p_subtitle_list, index );+                psz_subtitles = ixmlNode_getNodeValue( p_childNode );+                addSlave(psz_subtitles, SLAVE_TYPE_SPU);+            }+            ixmlNodeList_free( p_subtitle_list );+            psz_subtitles = xml_getChildElementValue( itemElement, "pv:subtitlefile" );             addSlave(psz_subtitles, SLAVE_TYPE_SPU);             psz_artist = xml_getChildElementValue( itemElement, "upnp:artist" );             psz_genre = xml_getChildElementValue( itemElement, "upnp:genre" );
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20180122/bb56c3d6/attachment.html>


More information about the vlc-devel mailing list