diff options
| author | Luke <luke.pulverenti@gmail.com> | 2017-03-17 16:25:15 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-03-17 16:25:15 -0400 |
| commit | 66a886adeffe40f41b1353d14fe8559ea134b83f (patch) | |
| tree | 30052119272e0778ec887e60458f1d4e779c9e8e /MediaBrowser.Api | |
| parent | 2928c753e24ae60024a63c8ea0d0b7f2b68a6383 (diff) | |
| parent | 3dcaeea20c3a7055dd8759e351d30c591ce1360d (diff) | |
Merge pull request #2532 from MediaBrowser/dev
Dev
Diffstat (limited to 'MediaBrowser.Api')
| -rw-r--r-- | MediaBrowser.Api/Playback/Hls/BaseHlsService.cs | 7 | ||||
| -rw-r--r-- | MediaBrowser.Api/Playback/StreamRequest.cs | 3 | ||||
| -rw-r--r-- | MediaBrowser.Api/Playback/StreamState.cs | 18 |
3 files changed, 26 insertions, 2 deletions
diff --git a/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs b/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs index 98115b840..d2f14f4b8 100644 --- a/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs +++ b/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs @@ -110,8 +110,11 @@ namespace MediaBrowser.Api.Playback.Hls throw; } - var waitForSegments = state.SegmentLength >= 10 ? 2 : 3; - await WaitForMinimumSegmentCount(playlist, waitForSegments, cancellationTokenSource.Token).ConfigureAwait(false); + var minSegments = state.MinSegments; + if (minSegments > 0) + { + await WaitForMinimumSegmentCount(playlist, minSegments, cancellationTokenSource.Token).ConfigureAwait(false); + } } } finally diff --git a/MediaBrowser.Api/Playback/StreamRequest.cs b/MediaBrowser.Api/Playback/StreamRequest.cs index d1bf9c120..f49fd87e0 100644 --- a/MediaBrowser.Api/Playback/StreamRequest.cs +++ b/MediaBrowser.Api/Playback/StreamRequest.cs @@ -42,6 +42,9 @@ namespace MediaBrowser.Api.Playback public string LiveStreamId { get; set; } public string Tag { get; set; } public string SegmentContainer { get; set; } + + public int? SegmentLength { get; set; } + public int? MinSegments { get; set; } } public class VideoStreamRequest : StreamRequest diff --git a/MediaBrowser.Api/Playback/StreamState.cs b/MediaBrowser.Api/Playback/StreamState.cs index 912d60889..22a0fa7c9 100644 --- a/MediaBrowser.Api/Playback/StreamState.cs +++ b/MediaBrowser.Api/Playback/StreamState.cs @@ -60,6 +60,11 @@ namespace MediaBrowser.Api.Playback { get { + if (Request.SegmentLength.HasValue) + { + return Request.SegmentLength.Value; + } + if (string.Equals(OutputVideoCodec, "copy", StringComparison.OrdinalIgnoreCase)) { var userAgent = UserAgent ?? string.Empty; @@ -86,6 +91,19 @@ namespace MediaBrowser.Api.Playback } } + public int MinSegments + { + get + { + if (Request.MinSegments.HasValue) + { + return Request.MinSegments.Value; + } + + return SegmentLength >= 10 ? 2 : 3; + } + } + public bool IsSegmentedLiveStream { get |
