diff --git a/Core/RenderManager.cs b/Core/RenderManager.cs index 0f05758..e258e98 100644 --- a/Core/RenderManager.cs +++ b/Core/RenderManager.cs @@ -601,7 +601,7 @@ namespace ADOFAIRenderer.Core if (_activeVideoFFmpeg != null) { - _activeVideoFFmpeg.Kill(); + _activeVideoFFmpeg.Kill(16384); _activeVideoFFmpeg = null; } diff --git a/Util/FFmpeg/FFmpegProcess.cs b/Util/FFmpeg/FFmpegProcess.cs index 065c180..43c6f1f 100644 --- a/Util/FFmpeg/FFmpegProcess.cs +++ b/Util/FFmpeg/FFmpegProcess.cs @@ -74,13 +74,17 @@ namespace ADOFAIRenderer.Util.FFmpeg } } - public void Kill() + public void Kill(int timeoutMs = 0) { try { if (_ffmpegProcess != null && !_ffmpegProcess.HasExited) { _ffmpegProcess.Kill(); + if (timeoutMs > 0) + { + _ffmpegProcess.WaitForExit(timeoutMs); + } } } catch (Exception)