From 0248d98877e309847d4534ab54eab3e6fed5040c Mon Sep 17 00:00:00 2001 From: Malte Rosenbjerg Date: Sun, 6 Dec 2020 00:34:50 +0100 Subject: [PATCH] Skip disconnect on cancelled Former-commit-id: db95448b14ae011451f9d0bd9da1c8567a415f03 --- FFMpegCore/FFMpeg/Arguments/PipeArgument.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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);