mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-10-01 21:03:46 +02:00
Make conversion cancelable
This commit is contained in:
@@ -86,8 +86,26 @@ export class Output<
|
||||
/** @internal */
|
||||
_finalizing = false;
|
||||
/** @internal */
|
||||
_finalized = false;
|
||||
/** @internal */
|
||||
_mutex = new AsyncMutex();
|
||||
|
||||
get isStarted() {
|
||||
return this._started;
|
||||
}
|
||||
|
||||
get isCanceled() {
|
||||
return this._canceled;
|
||||
}
|
||||
|
||||
get isFinalizing() {
|
||||
return this._finalizing;
|
||||
}
|
||||
|
||||
get isFinalized() {
|
||||
return this._finalized;
|
||||
}
|
||||
|
||||
constructor(options: OutputOptions<F, T>) {
|
||||
if (!options || typeof options !== 'object') {
|
||||
throw new TypeError('options must be an object.');
|
||||
@@ -334,6 +352,8 @@ export class Output<
|
||||
await this._writer.flush();
|
||||
await this._writer.finalize();
|
||||
|
||||
this._finalized = true;
|
||||
|
||||
release();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user