SHA256
Fix File.Delete Failure by Waiting for FFmpegProcess to Exit
This commit is contained in:
1 parent
54a4d2e7bb
commit
d7ca416980
2 files changed
+6
-2
No files matched your search
@@ -601,7 +601,7 @@ namespace ADOFAIRenderer.Core
|
||||
|
||||
if (_activeVideoFFmpeg != null)
|
||||
{
|
||||
_activeVideoFFmpeg.Kill();
|
||||
_activeVideoFFmpeg.Kill(16384);
|
||||
_activeVideoFFmpeg = null;
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user