From ac82e17d25fbf3da6d9a7810000d8c058ebf7fd8 Mon Sep 17 00:00:00 2001 From: Malte Rosenbjerg Date: Mon, 7 Dec 2020 01:20:13 +0100 Subject: [PATCH] Fix Former-commit-id: 203da6300bd2e4328e930761a54ba44c701b2731 --- FFMpegCore.Test/AudioTest.cs | 2 +- FFMpegCore.Test/Resources/TestResources.cs | 1 + FFMpegCore/FFMpeg/Arguments/InputPipeArgument.cs | 1 - FFMpegCore/FFMpeg/Arguments/OutputPipeArgument.cs | 1 - 4 files changed, 2 insertions(+), 3 deletions(-) diff --git a/FFMpegCore.Test/AudioTest.cs b/FFMpegCore.Test/AudioTest.cs index 9818e79..aee8982 100644 --- a/FFMpegCore.Test/AudioTest.cs +++ b/FFMpegCore.Test/AudioTest.cs @@ -38,7 +38,7 @@ public void Audio_Save() [TestMethod] public async Task Audio_FromRaw() { - await using var file = File.Open(VideoLibrary.LocalAudioRaw.FullName, FileMode.Open); + await using var file = File.Open(TestResources.RawAudio, FileMode.Open); var memoryStream = new MemoryStream(); await FFMpegArguments .FromPipeInput(new StreamPipeSource(file), options => options.ForceFormat("s16le")) diff --git a/FFMpegCore.Test/Resources/TestResources.cs b/FFMpegCore.Test/Resources/TestResources.cs index 765df38..f37ed0c 100644 --- a/FFMpegCore.Test/Resources/TestResources.cs +++ b/FFMpegCore.Test/Resources/TestResources.cs @@ -20,6 +20,7 @@ public static class TestResources public static readonly string WebmVideo = "./Resources/input_3sec.webm"; public static readonly string Mp4WithoutVideo = "./Resources/input_audio_only_10sec.mp4"; public static readonly string Mp4WithoutAudio = "./Resources/input_video_only_3sec.mp4"; + public static readonly string RawAudio = "./Resources/audio.raw"; public static readonly string Mp3Audio = "./Resources/audio.mp3"; public static readonly string PngImage = "./Resources/cover.png"; public static readonly string ImageCollection = "./Resources/images"; diff --git a/FFMpegCore/FFMpeg/Arguments/InputPipeArgument.cs b/FFMpegCore/FFMpeg/Arguments/InputPipeArgument.cs index 757b151..479fa90 100644 --- a/FFMpegCore/FFMpeg/Arguments/InputPipeArgument.cs +++ b/FFMpegCore/FFMpeg/Arguments/InputPipeArgument.cs @@ -25,7 +25,6 @@ protected override async Task ProcessDataAsync(CancellationToken token) if (!Pipe.IsConnected) throw new TaskCanceledException(); await Writer.WriteAsync(Pipe, token).ConfigureAwait(false); - Pipe.Disconnect(); } } } diff --git a/FFMpegCore/FFMpeg/Arguments/OutputPipeArgument.cs b/FFMpegCore/FFMpeg/Arguments/OutputPipeArgument.cs index a2cf9be..f089a1e 100644 --- a/FFMpegCore/FFMpeg/Arguments/OutputPipeArgument.cs +++ b/FFMpegCore/FFMpeg/Arguments/OutputPipeArgument.cs @@ -22,7 +22,6 @@ protected override async Task ProcessDataAsync(CancellationToken token) if (!Pipe.IsConnected) throw new TaskCanceledException(); await Reader.ReadAsync(Pipe, token).ConfigureAwait(false); - Pipe.Disconnect(); } } }