浏览代码

Fix DLNA DirectPlay

Shadowghost 3 年之前
父节点
当前提交
4e91c3ebdc
共有 2 个文件被更改,包括 3 次插入8 次删除
  1. 3 3
      MediaBrowser.Model/Dlna/StreamBuilder.cs
  2. 0 5
      MediaBrowser.Model/Dlna/StreamInfo.cs

+ 3 - 3
MediaBrowser.Model/Dlna/StreamBuilder.cs

@@ -664,7 +664,7 @@ namespace MediaBrowser.Model.Dlna
                     }
                     }
                 }
                 }
 
 
-                _logger.LogInformation(
+                _logger.LogDebug(
                     "DirectPlay Result for Profile: {0}, Path: {1}, PlayMethod: {2}, AudioStreamIndex: {3}, SubtitleStreamIndex: {4}, Reasons: {5}",
                     "DirectPlay Result for Profile: {0}, Path: {1}, PlayMethod: {2}, AudioStreamIndex: {3}, SubtitleStreamIndex: {4}, Reasons: {5}",
                     options.Profile.Name ?? "Anonymous Profile",
                     options.Profile.Name ?? "Anonymous Profile",
                     item.Path ?? "Unknown path",
                     item.Path ?? "Unknown path",
@@ -796,7 +796,7 @@ namespace MediaBrowser.Model.Dlna
                 playlistItem.SetOption(qualifier, "level", videoStream.Level.ToString());
                 playlistItem.SetOption(qualifier, "level", videoStream.Level.ToString());
             }
             }
 
 
-            // prefer matching audio codecs, could do beter here
+            // prefer matching audio codecs, could do better here
             var audioCodecs = ContainerProfile.SplitValue(audioCodec);
             var audioCodecs = ContainerProfile.SplitValue(audioCodec);
             var directAudioStream = candidateAudioStreams.FirstOrDefault(stream => ContainerProfile.ContainsContainer(audioCodecs, stream.Codec));
             var directAudioStream = candidateAudioStreams.FirstOrDefault(stream => ContainerProfile.ContainsContainer(audioCodecs, stream.Codec));
             playlistItem.AudioCodecs = audioCodecs;
             playlistItem.AudioCodecs = audioCodecs;
@@ -908,7 +908,7 @@ namespace MediaBrowser.Model.Dlna
                 playlistItem.VideoBitrate = Math.Max(Math.Min(availableBitrateForVideo, currentValue), 64_000);
                 playlistItem.VideoBitrate = Math.Max(Math.Min(availableBitrateForVideo, currentValue), 64_000);
             }
             }
 
 
-            _logger.LogInformation(
+            _logger.LogDebug(
                 "Transcode Result for Profile: {Profile}, Path: {Path}, PlayMethod: {PlayMethod}, AudioStreamIndex: {AudioStreamIndex}, SubtitleStreamIndex: {SubtitleStreamIndex}, Reasons: {TranscodeReason}",
                 "Transcode Result for Profile: {Profile}, Path: {Path}, PlayMethod: {PlayMethod}, AudioStreamIndex: {AudioStreamIndex}, SubtitleStreamIndex: {SubtitleStreamIndex}, Reasons: {TranscodeReason}",
                 options.Profile?.Name ?? "Anonymous Profile",
                 options.Profile?.Name ?? "Anonymous Profile",
                 item.Path ?? "Unknown path",
                 item.Path ?? "Unknown path",

+ 0 - 5
MediaBrowser.Model/Dlna/StreamInfo.cs

@@ -598,11 +598,6 @@ namespace MediaBrowser.Model.Dlna
 
 
         public string ToUrl(string baseUrl, string accessToken)
         public string ToUrl(string baseUrl, string accessToken)
         {
         {
-            if (PlayMethod == PlayMethod.DirectPlay)
-            {
-                return MediaSource.Path;
-            }
-
             if (string.IsNullOrEmpty(baseUrl))
             if (string.IsNullOrEmpty(baseUrl))
             {
             {
                 throw new ArgumentNullException(nameof(baseUrl));
                 throw new ArgumentNullException(nameof(baseUrl));