mirror of
https://github.com/rosenbjerg/FFMpegCore.git
synced 2024-11-10 08:34:12 +01:00
parent
209b8d8dd6
commit
9115485464
2 changed files with 24 additions and 16 deletions
|
@ -285,26 +285,28 @@ public void Video_ToMP4_Args_StreamPipe()
|
||||||
[TestMethod, Timeout(45000)]
|
[TestMethod, Timeout(45000)]
|
||||||
public void Video_ToMP4_Args_StreamOutputPipe_Async_Failure()
|
public void Video_ToMP4_Args_StreamOutputPipe_Async_Failure()
|
||||||
{
|
{
|
||||||
Assert.ThrowsException<FFMpegException>(() =>
|
using var ms = new MemoryStream();
|
||||||
{
|
var pipeSource = new StreamPipeDataReader(ms);
|
||||||
using var ms = new MemoryStream();
|
var result = FFMpegArguments
|
||||||
var pipeSource = new StreamPipeDataReader(ms);
|
.FromInputFiles(VideoLibrary.LocalVideo)
|
||||||
FFMpegArguments
|
.ForceFormat("mkv")
|
||||||
.FromInputFiles(VideoLibrary.LocalVideo)
|
.OutputToPipe(pipeSource)
|
||||||
.ForceFormat("mkv")
|
.ProcessAsynchronously()
|
||||||
.OutputToPipe(pipeSource)
|
.WaitForResult();
|
||||||
.ProcessAsynchronously()
|
Assert.IsFalse(result);
|
||||||
.WaitForResult();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod, Timeout(45000)]
|
[TestMethod, Timeout(45000)]
|
||||||
public void Video_ToMP4_Args_StreamOutputPipe_Failure()
|
public void Video_ToMP4_Args_StreamOutputPipe_Failure()
|
||||||
{
|
{
|
||||||
Assert.ThrowsException<FFMpegException>(() =>
|
using var ms = new MemoryStream();
|
||||||
{
|
var pipeSource = new StreamPipeDataReader(ms);
|
||||||
ConvertToStreamPipe(new ForceFormatArgument("mkv"));
|
var result = FFMpegArguments
|
||||||
});
|
.FromInputFiles(VideoLibrary.LocalVideo)
|
||||||
|
.ForceFormat("mkv")
|
||||||
|
.OutputToPipe(pipeSource)
|
||||||
|
.ProcessSynchronously();
|
||||||
|
Assert.IsFalse(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,13 @@ public void Post()
|
||||||
|
|
||||||
public async Task During(CancellationToken? cancellationToken = null)
|
public async Task During(CancellationToken? cancellationToken = null)
|
||||||
{
|
{
|
||||||
await ProcessDataAsync(cancellationToken ?? CancellationToken.None).ConfigureAwait(false);
|
try
|
||||||
|
{
|
||||||
|
await ProcessDataAsync(cancellationToken ?? CancellationToken.None).ConfigureAwait(false);
|
||||||
|
}
|
||||||
|
catch (TaskCanceledException)
|
||||||
|
{
|
||||||
|
}
|
||||||
Post();
|
Post();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue