mirror of
https://github.com/rosenbjerg/FFMpegCore.git
synced 2025-12-14 01:55:45 +00:00
Throw if CancellationToken passed to CancellableThrough is not already cancelled
This commit is contained in:
parent
3b1a1438bb
commit
3c6cb1fb43
1 changed files with 1 additions and 0 deletions
|
|
@ -85,6 +85,7 @@ public class FFMpegArgumentProcessor
|
|||
|
||||
public FFMpegArgumentProcessor CancellableThrough(CancellationToken token, int timeout = 0)
|
||||
{
|
||||
token.ThrowIfCancellationRequested();
|
||||
_cancellationTokenRegistration?.Dispose();
|
||||
_cancellationTokenRegistration = token.Register(() => Cancel(timeout));
|
||||
return this;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue