aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Api/Helpers/FileStreamResponseHelpers.cs
diff options
context:
space:
mode:
authorClaus Vium <cvium@users.noreply.github.com>2024-02-03 09:44:28 +0100
committerGitHub <noreply@github.com>2024-02-03 09:44:28 +0100
commit1e955c4347fc919dc6944dd526337c56b8803dc6 (patch)
tree9962f8b73717c4cf1711e966b8d7ef6e1545fba9 /Jellyfin.Api/Helpers/FileStreamResponseHelpers.cs
parente4f715bbee26985ae7666e4c80282ac52e7fce73 (diff)
parentdba043ef488310ab9db9ff7b29aedbfb790e3daa (diff)
Merge pull request #10801 from MarkCiliaVincenti/AsyncKeyedLock-migration
AsyncKeyedLock migration
Diffstat (limited to 'Jellyfin.Api/Helpers/FileStreamResponseHelpers.cs')
-rw-r--r--Jellyfin.Api/Helpers/FileStreamResponseHelpers.cs8
1 files changed, 1 insertions, 7 deletions
diff --git a/Jellyfin.Api/Helpers/FileStreamResponseHelpers.cs b/Jellyfin.Api/Helpers/FileStreamResponseHelpers.cs
index 5385979d4..cb178a61d 100644
--- a/Jellyfin.Api/Helpers/FileStreamResponseHelpers.cs
+++ b/Jellyfin.Api/Helpers/FileStreamResponseHelpers.cs
@@ -93,9 +93,7 @@ public static class FileStreamResponseHelpers
return new OkResult();
}
- var transcodingLock = transcodeManager.GetTranscodingLock(outputPath);
- await transcodingLock.WaitAsync(cancellationTokenSource.Token).ConfigureAwait(false);
- try
+ using (await transcodeManager.LockAsync(outputPath, cancellationTokenSource.Token).ConfigureAwait(false))
{
TranscodingJob? job;
if (!File.Exists(outputPath))
@@ -117,9 +115,5 @@ public static class FileStreamResponseHelpers
var stream = new ProgressiveFileStream(outputPath, job, transcodeManager);
return new FileStreamResult(stream, contentType);
}
- finally
- {
- transcodingLock.Release();
- }
}
}