mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
Backport pull request #11790 from jellyfin/release-10.9.z
Trickplay: kill ffmpeg when task is cancelled Original-merge: 4a344bebc08303edf888000bf52e64b1a4e8036f Merged-by: crobibero <cody@robibe.ro> Backported-by: Joshua M. Boniface <joshua@boniface.me>
This commit is contained in:
parent
e6dab2fa11
commit
833a1da355
@ -183,6 +183,7 @@
|
||||
- [btopherjohnson](https://github.com/btopherjohnson)
|
||||
- [GeorgeH005](https://github.com/GeorgeH005)
|
||||
- [Vedant](https://github.com/viktory36/)
|
||||
- [NotSaifA](https://github.com/NotSaifA)
|
||||
|
||||
# Emby Contributors
|
||||
|
||||
|
@ -943,7 +943,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||
var timeoutMs = _configurationManager.Configuration.ImageExtractionTimeoutMs;
|
||||
timeoutMs = timeoutMs <= 0 ? DefaultHdrImageExtractionTimeout : timeoutMs;
|
||||
|
||||
while (isResponsive)
|
||||
while (isResponsive && !cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
try
|
||||
{
|
||||
@ -957,8 +957,6 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||
// We don't actually expect the process to be finished in one timeout span, just that one image has been generated.
|
||||
}
|
||||
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
var jpegCount = _fileSystem.GetFilePaths(targetDirectory).Count();
|
||||
|
||||
isResponsive = jpegCount > lastCount;
|
||||
@ -967,7 +965,12 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||
|
||||
if (!ranToCompletion)
|
||||
{
|
||||
_logger.LogInformation("Stopping trickplay extraction due to process inactivity.");
|
||||
if (!isResponsive)
|
||||
{
|
||||
_logger.LogInformation("Trickplay process unresponsive.");
|
||||
}
|
||||
|
||||
_logger.LogInformation("Stopping trickplay extraction.");
|
||||
StopProcess(processWrapper, 1000);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user