diff options
Diffstat (limited to 'Emby.Server.Implementations/LiveTv/TunerHosts/M3UTunerHost.cs')
| -rw-r--r-- | Emby.Server.Implementations/LiveTv/TunerHosts/M3UTunerHost.cs | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/Emby.Server.Implementations/LiveTv/TunerHosts/M3UTunerHost.cs b/Emby.Server.Implementations/LiveTv/TunerHosts/M3UTunerHost.cs index c96d1f3592..04c5303f11 100644 --- a/Emby.Server.Implementations/LiveTv/TunerHosts/M3UTunerHost.cs +++ b/Emby.Server.Implementations/LiveTv/TunerHosts/M3UTunerHost.cs @@ -17,6 +17,7 @@ using MediaBrowser.Controller.Configuration; using MediaBrowser.Controller.MediaEncoding; using MediaBrowser.Model.Serialization; using MediaBrowser.Model.System; +using System.IO; namespace Emby.Server.Implementations.LiveTv.TunerHosts { @@ -75,6 +76,14 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts return Task.FromResult(list); } + private string[] _disallowedSharedStreamExtensions = new string[] + { + ".mkv", + ".mp4", + ".m3u8", + ".mpd" + }; + protected override async Task<ILiveStream> GetChannelStream(TunerHostInfo info, string channelId, string streamId, CancellationToken cancellationToken) { var tunerCount = info.TunerCount; @@ -95,7 +104,12 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts if (mediaSource.Protocol == MediaProtocol.Http && !mediaSource.RequiresLooping) { - return new SharedHttpStream(mediaSource, info, streamId, FileSystem, _httpClient, Logger, Config.ApplicationPaths, _appHost, _environment); + var extension = Path.GetExtension(mediaSource.Path) ?? string.Empty; + + if (!_disallowedSharedStreamExtensions.Contains(extension, StringComparer.OrdinalIgnoreCase)) + { + return new SharedHttpStream(mediaSource, info, streamId, FileSystem, _httpClient, Logger, Config.ApplicationPaths, _appHost, _environment); + } } return new LiveStream(mediaSource, info, _environment, FileSystem, Logger, Config.ApplicationPaths); @@ -152,6 +166,8 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts isRemote = !_networkManager.IsInLocalNetwork(uri.Host); } + var supportsDirectPlay = !info.EnableStreamLooping && info.TunerCount == 0; + var mediaSource = new MediaSourceInfo { Path = path, @@ -183,7 +199,8 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts IsInfiniteStream = true, IsRemote = isRemote, - IgnoreDts = true + IgnoreDts = true, + SupportsDirectPlay = supportsDirectPlay }; mediaSource.InferTotalBitrate(); |
