aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/LiveTv/TunerHosts/M3UTunerHost.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Emby.Server.Implementations/LiveTv/TunerHosts/M3UTunerHost.cs')
-rw-r--r--Emby.Server.Implementations/LiveTv/TunerHosts/M3UTunerHost.cs16
1 files changed, 14 insertions, 2 deletions
diff --git a/Emby.Server.Implementations/LiveTv/TunerHosts/M3UTunerHost.cs b/Emby.Server.Implementations/LiveTv/TunerHosts/M3UTunerHost.cs
index e41fb7fbeb..c96d1f3592 100644
--- a/Emby.Server.Implementations/LiveTv/TunerHosts/M3UTunerHost.cs
+++ b/Emby.Server.Implementations/LiveTv/TunerHosts/M3UTunerHost.cs
@@ -77,16 +77,28 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts
protected override async Task<ILiveStream> GetChannelStream(TunerHostInfo info, string channelId, string streamId, CancellationToken cancellationToken)
{
+ var tunerCount = info.TunerCount;
+
+ if (tunerCount > 0)
+ {
+ var liveStreams = await EmbyTV.EmbyTV.Current.GetLiveStreams(info, cancellationToken).ConfigureAwait(false);
+
+ if (liveStreams.Count >= info.TunerCount)
+ {
+ throw new LiveTvConflictException();
+ }
+ }
+
var sources = await GetChannelStreamMediaSources(info, channelId, cancellationToken).ConfigureAwait(false);
var mediaSource = sources.First();
if (mediaSource.Protocol == MediaProtocol.Http && !mediaSource.RequiresLooping)
{
- return new SharedHttpStream(mediaSource, streamId, FileSystem, _httpClient, Logger, Config.ApplicationPaths, _appHost, _environment);
+ return new SharedHttpStream(mediaSource, info, streamId, FileSystem, _httpClient, Logger, Config.ApplicationPaths, _appHost, _environment);
}
- return new LiveStream(mediaSource, _environment, FileSystem, Logger, Config.ApplicationPaths);
+ return new LiveStream(mediaSource, info, _environment, FileSystem, Logger, Config.ApplicationPaths);
}
public async Task Validate(TunerHostInfo info)