mirror of
https://github.com/rosenbjerg/FFMpegCore.git
synced 2025-12-16 11:05:44 +00:00
Cancel on exit
This commit is contained in:
parent
26f5b0f4f4
commit
31685da18a
1 changed files with 1 additions and 1 deletions
|
|
@ -55,6 +55,7 @@ namespace FFMpegCore
|
||||||
cancellationTokenSource.Cancel();
|
cancellationTokenSource.Cancel();
|
||||||
}
|
}
|
||||||
CancelEvent += OnCancelEvent;
|
CancelEvent += OnCancelEvent;
|
||||||
|
instance.Exited += delegate { cancellationTokenSource.Cancel(); };
|
||||||
|
|
||||||
_ffMpegArguments.Pre();
|
_ffMpegArguments.Pre();
|
||||||
try
|
try
|
||||||
|
|
@ -128,7 +129,6 @@ namespace FFMpegCore
|
||||||
FFMpegHelper.RootExceptionCheck();
|
FFMpegHelper.RootExceptionCheck();
|
||||||
FFMpegHelper.VerifyFFMpegExists();
|
FFMpegHelper.VerifyFFMpegExists();
|
||||||
var instance = new Instance(FFMpegOptions.Options.FFmpegBinary(), _ffMpegArguments.Text);
|
var instance = new Instance(FFMpegOptions.Options.FFmpegBinary(), _ffMpegArguments.Text);
|
||||||
instance.DataReceived += OutputData;
|
|
||||||
cancellationTokenSource = new CancellationTokenSource();
|
cancellationTokenSource = new CancellationTokenSource();
|
||||||
|
|
||||||
if (_onTimeProgress != null || (_onPercentageProgress != null && _totalTimespan != null))
|
if (_onTimeProgress != null || (_onPercentageProgress != null && _totalTimespan != null))
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue