mirror of
https://github.com/rosenbjerg/FFMpegCore.git
synced 2024-11-10 08:34:12 +01:00
Fix output pipe hanging on unix sockets
This commit is contained in:
parent
6b1e411bfe
commit
9feb9f5a22
2 changed files with 4 additions and 6 deletions
|
@ -38,12 +38,12 @@ public async Task During(CancellationToken cancellationToken = default)
|
|||
{
|
||||
try
|
||||
{
|
||||
await ProcessDataAsync(cancellationToken ?? CancellationToken.None).ConfigureAwait(false);
|
||||
await ProcessDataAsync(cancellationToken);
|
||||
}
|
||||
catch (TaskCanceledException)
|
||||
{
|
||||
}
|
||||
Post();
|
||||
Pipe.Disconnect();
|
||||
}
|
||||
|
||||
protected abstract Task ProcessDataAsync(CancellationToken token);
|
||||
|
|
|
@ -63,9 +63,8 @@ void OnCancelEvent(object sender, EventArgs args)
|
|||
Task.WaitAll(instance.FinishedRunning().ContinueWith(t =>
|
||||
{
|
||||
errorCode = t.Result;
|
||||
cancellationTokenSource.Cancel();
|
||||
}), _ffMpegArguments.During(cancellationTokenSource.Token));
|
||||
_ffMpegArguments.Post();
|
||||
}), _ffMpegArguments.During(cancellationTokenSource.Token));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
@ -108,7 +107,7 @@ void OnCancelEvent(object sender, EventArgs args)
|
|||
await Task.WhenAll(instance.FinishedRunning().ContinueWith(t =>
|
||||
{
|
||||
errorCode = t.Result;
|
||||
cancellationTokenSource.Cancel();
|
||||
_ffMpegArguments.Post();
|
||||
}), _ffMpegArguments.During(cancellationTokenSource.Token)).ConfigureAwait(false);
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -118,7 +117,6 @@ await Task.WhenAll(instance.FinishedRunning().ContinueWith(t =>
|
|||
finally
|
||||
{
|
||||
CancelEvent -= OnCancelEvent;
|
||||
_ffMpegArguments.Post();
|
||||
}
|
||||
|
||||
return HandleCompletion(throwOnError, errorCode, instance.ErrorData);
|
||||
|
|
Loading…
Reference in a new issue