diff --git a/FFMpegCore/FFMpeg/Arguments/PipeArgument.cs b/FFMpegCore/FFMpeg/Arguments/PipeArgument.cs index 12d84d1..3d451e9 100644 --- a/FFMpegCore/FFMpeg/Arguments/PipeArgument.cs +++ b/FFMpegCore/FFMpeg/Arguments/PipeArgument.cs @@ -42,12 +42,12 @@ public async Task During(CancellationToken cancellationToken = default) { await ProcessDataAsync(cancellationToken); Debug.WriteLine($"Disconnecting NamedPipeServerStream on {GetType().Name}"); + Pipe.Disconnect(); } catch (TaskCanceledException) { Debug.WriteLine($"ProcessDataAsync on {GetType().Name} cancelled"); } - Pipe.Disconnect(); } protected abstract Task ProcessDataAsync(CancellationToken token);