mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-05-24 02:02:29 -04:00
Always cleanup trickplay temp for ffmpeg failures (#13030)
This commit is contained in:
parent
d292fde9e2
commit
9e61a6fd72
@ -1035,6 +1035,16 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||
if (exitCode == -1)
|
||||
{
|
||||
_logger.LogError("ffmpeg image extraction failed for {ProcessDescription}", processDescription);
|
||||
// Cleanup temp folder here, because the targetDirectory is not returned and the cleanup for failed ffmpeg process is not possible for caller.
|
||||
// Ideally the ffmpeg should not write any files if it fails, but it seems like it is not guaranteed.
|
||||
try
|
||||
{
|
||||
Directory.Delete(targetDirectory, true);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_logger.LogError(e, "Failed to delete ffmpeg temp directory {TargetDirectory}", targetDirectory);
|
||||
}
|
||||
|
||||
throw new FfmpegException(string.Format(CultureInfo.InvariantCulture, "ffmpeg image extraction failed for {0}", processDescription));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user