Wednesday, May 28, 2014

VLC And DLNA subtitles

If you happen to have an Twonky DLNA media server and you can't get to see the subtitles on videos, try the patch below to VLC. Tested on 2.1.3, 2.1.4 (unreleased). Also applies to git current as of 2014-05-28.

EDIT: This patch was merged to vlc's git!

--- modules/services_discovery/upnp.cpp~        2013-06-24 15:00:38.000000000 -0300
+++ modules/services_discovery/upnp.cpp 2014-05-28 13:00:25.159999056 -0300
@@ -822,7 +822,8 @@
     IXML_Document* p_response = _browseAction( p_parent->getObjectID(),
                                       "BrowseDirectChildren",
                                       "id,dc:title,res," /* Filter */
-                                      "sec:CaptionInfo,sec:CaptionInfoEx",
+                                      "sec:CaptionInfo,sec:CaptionInfoEx,"
+                                      "pv:subtitlefile",
                                       psz_starting_index, /* StartingIndex */
                                       "0", /* RequestedCount */
                                       "" /* SortCriteria */
@@ -912,6 +913,10 @@
                 psz_subtitles = xml_getChildElementValue( itemElement,
                         "sec:CaptionInfoEx" );

+            if ( !psz_subtitles )
+                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" );
             if ( p_resource_list )