mirror of
https://github.com/rosenbjerg/FFMpegCore.git
synced 2025-12-14 10:05:44 +00:00
Throw OperationCancelledException in this case to provide more uniform and expected behavior. Fixes #594
18 lines
608 B
C#
18 lines
608 B
C#
using Instances;
|
|
|
|
namespace FFMpegCore;
|
|
|
|
public static class ProcessArgumentsExtensions
|
|
{
|
|
public static IProcessResult StartAndWaitForExit(this ProcessArguments processArguments)
|
|
{
|
|
using var instance = processArguments.Start();
|
|
return instance.WaitForExit();
|
|
}
|
|
|
|
public static async Task<IProcessResult> StartAndWaitForExitAsync(this ProcessArguments processArguments, CancellationToken cancellationToken = default)
|
|
{
|
|
using var instance = processArguments.Start();
|
|
return await instance.WaitForExitAsync(cancellationToken).ConfigureAwait(false);
|
|
}
|
|
}
|