mirror of
https://github.com/rosenbjerg/FFMpegCore.git
synced 2025-12-15 18:45:44 +00:00
parent
b0e3d157d3
commit
b2c28adcd4
2 changed files with 4 additions and 6 deletions
|
|
@ -38,12 +38,12 @@ namespace FFMpegCore.Arguments
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await ProcessDataAsync(cancellationToken ?? CancellationToken.None).ConfigureAwait(false);
|
await ProcessDataAsync(cancellationToken);
|
||||||
}
|
}
|
||||||
catch (TaskCanceledException)
|
catch (TaskCanceledException)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
Post();
|
Pipe.Disconnect();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected abstract Task ProcessDataAsync(CancellationToken token);
|
protected abstract Task ProcessDataAsync(CancellationToken token);
|
||||||
|
|
|
||||||
|
|
@ -63,9 +63,8 @@ namespace FFMpegCore
|
||||||
Task.WaitAll(instance.FinishedRunning().ContinueWith(t =>
|
Task.WaitAll(instance.FinishedRunning().ContinueWith(t =>
|
||||||
{
|
{
|
||||||
errorCode = t.Result;
|
errorCode = t.Result;
|
||||||
cancellationTokenSource.Cancel();
|
|
||||||
}), _ffMpegArguments.During(cancellationTokenSource.Token));
|
|
||||||
_ffMpegArguments.Post();
|
_ffMpegArguments.Post();
|
||||||
|
}), _ffMpegArguments.During(cancellationTokenSource.Token));
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
|
@ -108,7 +107,7 @@ namespace FFMpegCore
|
||||||
await Task.WhenAll(instance.FinishedRunning().ContinueWith(t =>
|
await Task.WhenAll(instance.FinishedRunning().ContinueWith(t =>
|
||||||
{
|
{
|
||||||
errorCode = t.Result;
|
errorCode = t.Result;
|
||||||
cancellationTokenSource.Cancel();
|
_ffMpegArguments.Post();
|
||||||
}), _ffMpegArguments.During(cancellationTokenSource.Token)).ConfigureAwait(false);
|
}), _ffMpegArguments.During(cancellationTokenSource.Token)).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
|
@ -118,7 +117,6 @@ namespace FFMpegCore
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
CancelEvent -= OnCancelEvent;
|
CancelEvent -= OnCancelEvent;
|
||||||
_ffMpegArguments.Post();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return HandleCompletion(throwOnError, errorCode, instance.ErrorData);
|
return HandleCompletion(throwOnError, errorCode, instance.ErrorData);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue