aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Api/Helpers/AudioHelper.cs
diff options
context:
space:
mode:
authorcvium <clausvium@gmail.com>2021-09-10 09:29:14 +0200
committercvium <clausvium@gmail.com>2021-09-10 09:29:14 +0200
commit1603d1928e888abeccc6a5fab2e1f13aa65eea6c (patch)
tree4be38a370ab2c2340af7a547f1c79390c2de42cc /Jellyfin.Api/Helpers/AudioHelper.cs
parentb96dbbf553820861eab9d1a453adcc8ce8a9ef05 (diff)
Kill ProgressiveFileCopier and seek to end for ongoing livetv
Diffstat (limited to 'Jellyfin.Api/Helpers/AudioHelper.cs')
-rw-r--r--Jellyfin.Api/Helpers/AudioHelper.cs19
1 files changed, 5 insertions, 14 deletions
diff --git a/Jellyfin.Api/Helpers/AudioHelper.cs b/Jellyfin.Api/Helpers/AudioHelper.cs
index ddcde1cf6..19da180e5 100644
--- a/Jellyfin.Api/Helpers/AudioHelper.cs
+++ b/Jellyfin.Api/Helpers/AudioHelper.cs
@@ -120,14 +120,10 @@ namespace Jellyfin.Api.Helpers
{
StreamingHelpers.AddDlnaHeaders(state, _httpContextAccessor.HttpContext.Response.Headers, true, streamingRequest.StartTimeTicks, _httpContextAccessor.HttpContext.Request, _dlnaManager);
- await new ProgressiveFileCopier(state.DirectStreamProvider, null, _transcodingJobHelper, CancellationToken.None)
- {
- AllowEndOfFile = false
- }.WriteToAsync(_httpContextAccessor.HttpContext.Response.Body, CancellationToken.None)
- .ConfigureAwait(false);
-
+ var liveStreamInfo = _mediaSourceManager.GetLiveStreamInfo(streamingRequest.LiveStreamId);
+ var liveStream = new ProgressiveFileStream(liveStreamInfo.GetStream(), null, _transcodingJobHelper);
// TODO (moved from MediaBrowser.Api): Don't hardcode contentType
- return new FileStreamResult(_httpContextAccessor.HttpContext.Response.Body, MimeTypes.GetMimeType("file.ts")!);
+ return new FileStreamResult(liveStream, MimeTypes.GetMimeType("file.ts"));
}
// Static remote stream
@@ -159,13 +155,8 @@ namespace Jellyfin.Api.Helpers
if (state.MediaSource.IsInfiniteStream)
{
- await new ProgressiveFileCopier(state.MediaPath, null, _transcodingJobHelper, CancellationToken.None)
- {
- AllowEndOfFile = false
- }.WriteToAsync(_httpContextAccessor.HttpContext.Response.Body, CancellationToken.None)
- .ConfigureAwait(false);
-
- return new FileStreamResult(_httpContextAccessor.HttpContext.Response.Body, contentType);
+ var stream = new ProgressiveFileStream(state.MediaPath, null, _transcodingJobHelper);
+ return new FileStreamResult(stream, contentType);
}
return FileStreamResponseHelpers.GetStaticFileResult(