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

Rémi Denis-Courmont remi at remlab.net
Tue Jan 23 08:25:23 CET 2018


Le 23 janvier 2018 00:25:23 GMT+02:00, sam_ at centrum.sk a écrit :
>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" );

I wouldn't be surprised if this caused compatibility or performance issues with some servers, though. VLC will fetch all subs regardless of which is used.
-- 
Remi Denis-Courmont


More information about the vlc-devel mailing list