mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
Fix for new WaitForExitAsync method
This commit is contained in:
parent
cd662506a1
commit
6b94d55e1e
@ -920,14 +920,22 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
|||||||
|
|
||||||
bool isResponsive = true;
|
bool isResponsive = true;
|
||||||
int lastCount = 0;
|
int lastCount = 0;
|
||||||
|
var timeoutMs = _configurationManager.Configuration.ImageExtractionTimeoutMs;
|
||||||
|
timeoutMs = timeoutMs <= 0 ? DefaultHdrImageExtractionTimeout : timeoutMs;
|
||||||
|
|
||||||
while (isResponsive)
|
while (isResponsive)
|
||||||
{
|
{
|
||||||
if (await process.WaitForExitAsync(TimeSpan.FromSeconds(30)).ConfigureAwait(false))
|
try
|
||||||
{
|
{
|
||||||
|
await process.WaitForExitAsync(TimeSpan.FromMilliseconds(timeoutMs)).ConfigureAwait(false);
|
||||||
|
|
||||||
ranToCompletion = true;
|
ranToCompletion = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
catch (OperationCanceledException)
|
||||||
|
{
|
||||||
|
// We don't actually expect the process to be finished in one timeout span, just that one image has been generated.
|
||||||
|
}
|
||||||
|
|
||||||
cancellationToken.ThrowIfCancellationRequested();
|
cancellationToken.ThrowIfCancellationRequested();
|
||||||
|
|
||||||
@ -939,7 +947,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
|||||||
|
|
||||||
if (!ranToCompletion)
|
if (!ranToCompletion)
|
||||||
{
|
{
|
||||||
_logger.LogInformation("Killing ffmpeg extraction process due to inactivity.");
|
_logger.LogInformation("Stopping trickplay extraction due to process inactivity.");
|
||||||
StopProcess(processWrapper, 1000);
|
StopProcess(processWrapper, 1000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user