Circumvent flush() being called on sources when cancelling output, surface error before doing cleanup

This commit is contained in:
Vanilagy
2025-08-10 03:24:17 +02:00
parent 64f986bc1b
commit ba0491de3a
7 changed files with 46 additions and 33 deletions
+2 -2
View File
@@ -380,7 +380,7 @@ export class Output<
const release = await this._mutex.acquire();
const promises = this._tracks.map(x => x.source._flushOrWaitForClose());
const promises = this._tracks.map(x => x.source._flushOrWaitForOngoingClose(true)); // Force close
await Promise.all(promises);
await this._writer.close();
@@ -410,7 +410,7 @@ export class Output<
const release = await this._mutex.acquire();
const promises = this._tracks.map(x => x.source._flushOrWaitForClose());
const promises = this._tracks.map(x => x.source._flushOrWaitForOngoingClose(false));
await Promise.all(promises);
await this._muxer.finalize();