diff options
| author | Claus Vium <cvium@users.noreply.github.com> | 2024-02-03 09:44:28 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-03 09:44:28 +0100 |
| commit | 1e955c4347fc919dc6944dd526337c56b8803dc6 (patch) | |
| tree | 9962f8b73717c4cf1711e966b8d7ef6e1545fba9 /Jellyfin.Api/Helpers/FileStreamResponseHelpers.cs | |
| parent | e4f715bbee26985ae7666e4c80282ac52e7fce73 (diff) | |
| parent | dba043ef488310ab9db9ff7b29aedbfb790e3daa (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.cs | 8 |
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(); - } } } |
