From 463cb3e35420ab23ebac0785943443daf0d32216 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Tue, 4 Apr 2017 02:01:20 -0400 Subject: [PATCH] update live stream management --- MediaBrowser.Api/Playback/StreamRequest.cs | 1 - MediaBrowser.Controller/MediaEncoding/EncodingJobOptions.cs | 1 + MediaBrowser.MediaEncoding/Encoder/BaseEncoder.cs | 2 +- MediaBrowser.MediaEncoding/Encoder/EncodingJob.cs | 3 +-- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/MediaBrowser.Api/Playback/StreamRequest.cs b/MediaBrowser.Api/Playback/StreamRequest.cs index ecb6350cd..d02b4bae6 100644 --- a/MediaBrowser.Api/Playback/StreamRequest.cs +++ b/MediaBrowser.Api/Playback/StreamRequest.cs @@ -37,7 +37,6 @@ namespace MediaBrowser.Api.Playback public string Params { get; set; } public string PlaySessionId { get; set; } - public string LiveStreamId { get; set; } public string Tag { get; set; } public string SegmentContainer { get; set; } diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingJobOptions.cs b/MediaBrowser.Controller/MediaEncoding/EncodingJobOptions.cs index f044db3d0..30deae842 100644 --- a/MediaBrowser.Controller/MediaEncoding/EncodingJobOptions.cs +++ b/MediaBrowser.Controller/MediaEncoding/EncodingJobOptions.cs @@ -192,6 +192,7 @@ namespace MediaBrowser.Controller.MediaEncoding public int? TranscodingMaxAudioChannels { get; set; } public int? CpuCoreLimit { get; set; } public string OutputContainer { get; set; } + public string LiveStreamId { get; set; } /// /// Gets or sets the video codec. diff --git a/MediaBrowser.MediaEncoding/Encoder/BaseEncoder.cs b/MediaBrowser.MediaEncoding/Encoder/BaseEncoder.cs index b6e695f1b..c0440e132 100644 --- a/MediaBrowser.MediaEncoding/Encoder/BaseEncoder.cs +++ b/MediaBrowser.MediaEncoding/Encoder/BaseEncoder.cs @@ -350,7 +350,7 @@ namespace MediaBrowser.MediaEncoding.Encoder state.IsoMount = await IsoManager.Mount(state.MediaPath, cancellationToken).ConfigureAwait(false); } - if (state.MediaSource.RequiresOpening && string.IsNullOrWhiteSpace(state.LiveStreamId)) + if (state.MediaSource.RequiresOpening && string.IsNullOrWhiteSpace(state.Options.LiveStreamId)) { var liveStreamResponse = await MediaSourceManager.OpenLiveStream(new LiveStreamRequest { diff --git a/MediaBrowser.MediaEncoding/Encoder/EncodingJob.cs b/MediaBrowser.MediaEncoding/Encoder/EncodingJob.cs index 883709de8..98adb6e20 100644 --- a/MediaBrowser.MediaEncoding/Encoder/EncodingJob.cs +++ b/MediaBrowser.MediaEncoding/Encoder/EncodingJob.cs @@ -38,7 +38,6 @@ namespace MediaBrowser.MediaEncoding.Encoder public bool EstimateContentLength { get; set; } public TranscodeSeekInfo TranscodeSeekInfo { get; set; } public long? EncodingDurationTicks { get; set; } - public string LiveStreamId { get; set; } public string ItemType { get; set; } @@ -94,7 +93,7 @@ namespace MediaBrowser.MediaEncoding.Encoder private async void DisposeLiveStream() { - if (MediaSource.RequiresClosing) + if (MediaSource.RequiresClosing && string.IsNullOrWhiteSpace(Options.LiveStreamId) && !string.IsNullOrWhiteSpace(MediaSource.LiveStreamId)) { try {