diff options
| author | Luke <luke.pulverenti@gmail.com> | 2016-09-18 16:39:35 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-09-18 16:39:35 -0400 |
| commit | 4ea1cd5d1237ea622b31652fff3fe4827f5c6b4b (patch) | |
| tree | 4e0cdd828e6a25a74be1d7b77c6759c759d6c88d /MediaBrowser.Server.Implementations/Library | |
| parent | 2c661f1cabb9f8b429a41670521f2d37bf9c0922 (diff) | |
| parent | 05edb9f4bdcdf7733bcd7e6e74a876bbc2b5c064 (diff) | |
Merge pull request #2180 from MediaBrowser/dev
update timeshifting
Diffstat (limited to 'MediaBrowser.Server.Implementations/Library')
| -rw-r--r-- | MediaBrowser.Server.Implementations/Library/MediaSourceManager.cs | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/MediaBrowser.Server.Implementations/Library/MediaSourceManager.cs b/MediaBrowser.Server.Implementations/Library/MediaSourceManager.cs index 4a533ff93..c20245a6e 100644 --- a/MediaBrowser.Server.Implementations/Library/MediaSourceManager.cs +++ b/MediaBrowser.Server.Implementations/Library/MediaSourceManager.cs @@ -221,8 +221,28 @@ namespace MediaBrowser.Server.Implementations.Library } } - public async Task<MediaSourceInfo> GetMediaSource(IHasMediaSources item, string mediaSourceId, bool enablePathSubstitution) + public async Task<MediaSourceInfo> GetMediaSource(IHasMediaSources item, string mediaSourceId, string liveStreamId, bool enablePathSubstitution, CancellationToken cancellationToken) { + if (!string.IsNullOrWhiteSpace(liveStreamId)) + { + return await GetLiveStream(liveStreamId, cancellationToken).ConfigureAwait(false); + } + //await _liveStreamSemaphore.WaitAsync(cancellationToken).ConfigureAwait(false); + + //try + //{ + // var stream = _openStreams.Values.FirstOrDefault(i => string.Equals(i.MediaSource.Id, mediaSourceId, StringComparison.OrdinalIgnoreCase)); + + // if (stream != null) + // { + // return stream.MediaSource; + // } + //} + //finally + //{ + // _liveStreamSemaphore.Release(); + //} + var sources = await GetPlayackMediaSources(item.Id.ToString("N"), null, enablePathSubstitution, new[] { MediaType.Audio, MediaType.Video }, CancellationToken.None).ConfigureAwait(false); |
