From 43cb11f694210de6e2666665a3d9c7f33a6eacd3 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 18 Nov 2017 23:59:34 -0500 Subject: [PATCH] update shared stream support --- .../LiveTv/TunerHosts/SharedHttpStream.cs | 11 +++++++---- MediaBrowser.Model/Dlna/StreamBuilder.cs | 10 +++------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/Emby.Server.Implementations/LiveTv/TunerHosts/SharedHttpStream.cs b/Emby.Server.Implementations/LiveTv/TunerHosts/SharedHttpStream.cs index a3bfff7c17..fc9244f6a5 100644 --- a/Emby.Server.Implementations/LiveTv/TunerHosts/SharedHttpStream.cs +++ b/Emby.Server.Implementations/LiveTv/TunerHosts/SharedHttpStream.cs @@ -65,10 +65,13 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts var requiresRemux = false; var contentType = response.ContentType ?? string.Empty; - if (contentType.IndexOf("mp4", StringComparison.OrdinalIgnoreCase) != -1 || - contentType.IndexOf("matroska", StringComparison.OrdinalIgnoreCase) != -1 || - contentType.IndexOf("dash", StringComparison.OrdinalIgnoreCase) != -1 || - contentType.IndexOf("mpegURL", StringComparison.OrdinalIgnoreCase) != -1) + if (contentType.IndexOf("matroska", StringComparison.OrdinalIgnoreCase) != -1) + { + extension = "mkv"; + } + else if (contentType.IndexOf("mp4", StringComparison.OrdinalIgnoreCase) != -1 || + contentType.IndexOf("dash", StringComparison.OrdinalIgnoreCase) != -1 || + contentType.IndexOf("mpegURL", StringComparison.OrdinalIgnoreCase) != -1) { requiresRemux = true; } diff --git a/MediaBrowser.Model/Dlna/StreamBuilder.cs b/MediaBrowser.Model/Dlna/StreamBuilder.cs index b80a2baa9f..37d266ac09 100644 --- a/MediaBrowser.Model/Dlna/StreamBuilder.cs +++ b/MediaBrowser.Model/Dlna/StreamBuilder.cs @@ -1335,19 +1335,15 @@ namespace MediaBrowser.Model.Dlna return true; } - if (!maxBitrate.HasValue) - { - _logger.Info("Cannot " + playMethod + " due to unknown supported bitrate"); - return false; - } + var requestedMaxBitrate = maxBitrate ?? 1000000; // If we don't know the bitrate, then force a transcode if requested max bitrate is under 40 mbps var itemBitrate = item.Bitrate ?? 40000000; - if (itemBitrate > maxBitrate.Value) + if (itemBitrate > requestedMaxBitrate) { - _logger.Info("Bitrate exceeds " + playMethod + " limit: media bitrate: {0}, max bitrate: {1}", item.Bitrate.Value.ToString(CultureInfo.InvariantCulture), maxBitrate.Value.ToString(CultureInfo.InvariantCulture)); + _logger.Info("Bitrate exceeds " + playMethod + " limit: media bitrate: {0}, max bitrate: {1}", item.Bitrate.Value.ToString(CultureInfo.InvariantCulture), requestedMaxBitrate.ToString(CultureInfo.InvariantCulture)); return false; }