瀏覽代碼

fix samsung dlna subtitles

Luke Pulverenti 9 年之前
父節點
當前提交
49c678037a
共有 2 個文件被更改,包括 11 次插入11 次删除
  1. 10 10
      MediaBrowser.Dlna/Didl/DidlBuilder.cs
  2. 1 1
      MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs

+ 10 - 10
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
                 // <sec:CaptionInfoEx sec:type="srt">http://192.168.1.3:9999/video.srt</sec:CaptionInfoEx>
                 // <sec:CaptionInfo sec:type="srt">http://192.168.1.3:9999/video.srt</sec:CaptionInfo>
 
-                //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)

+ 1 - 1
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)
             {