From 49c678037a329f35de0ff09999b79cd8a1d4694d Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Tue, 22 Mar 2016 00:15:12 -0400 Subject: [PATCH] fix samsung dlna subtitles --- MediaBrowser.Dlna/Didl/DidlBuilder.cs | 20 +++++++++---------- .../Subtitles/SubtitleEncoder.cs | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/MediaBrowser.Dlna/Didl/DidlBuilder.cs b/MediaBrowser.Dlna/Didl/DidlBuilder.cs index 91d1af8f4..e8e969a5f 100644 --- a/MediaBrowser.Dlna/Didl/DidlBuilder.cs +++ b/MediaBrowser.Dlna/Didl/DidlBuilder.cs @@ -188,15 +188,15 @@ namespace MediaBrowser.Dlna.Didl { var subtitleAdded = AddSubtitleElement(container, subtitle); - if (subtitleAdded && _profile.EnableSingleSubtitleLimit) - { - break; - } + if (subtitleAdded && _profile.EnableSingleSubtitleLimit) + { + break; + } } } } - private bool AddSubtitleElement(XmlElement container, SubtitleStreamInfo info) + private bool AddSubtitleElement(XmlElement container, SubtitleStreamInfo info) { var subtitleProfile = _profile.SubtitleProfiles .FirstOrDefault(i => string.Equals(info.Format, i.Format, StringComparison.OrdinalIgnoreCase) && i.Method == SubtitleDeliveryMethod.External); @@ -213,13 +213,13 @@ namespace MediaBrowser.Dlna.Didl // http://192.168.1.3:9999/video.srt // http://192.168.1.3:9999/video.srt - //var res = container.OwnerDocument.CreateElement("SEC", "CaptionInfoEx"); + var res = container.OwnerDocument.CreateElement("CaptionInfoEx", "sec"); - //res.InnerText = info.Url; + res.InnerText = info.Url; //// TODO: attribute needs SEC: - //res.SetAttribute("type", info.Format.ToLower()); - //container.AppendChild(res); + res.SetAttribute("type", "sec", info.Format.ToLower()); + container.AppendChild(res); } else if (string.Equals(subtitleMode, "smi", StringComparison.OrdinalIgnoreCase)) { @@ -243,7 +243,7 @@ namespace MediaBrowser.Dlna.Didl container.AppendChild(res); } - return true; + return true; } private void AddVideoResource(XmlElement container, IHasMediaSources video, string deviceId, Filter filter, string contentFeatures, StreamInfo streamInfo) diff --git a/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs b/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs index 882b2e1c2..cbe24bda8 100644 --- a/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs +++ b/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs @@ -604,7 +604,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles process.StandardError.BaseStream.CopyToAsync(logFileStream); - var ranToCompletion = process.WaitForExit(120000); + var ranToCompletion = process.WaitForExit(300000); if (!ranToCompletion) {