Add support for writing Unix epoch-relative tracks to HLS, add proper cleanup of all Targets obtained by an Output

This commit is contained in:
Vanilagy
2026-03-31 15:12:38 +02:00
parent b06e407d65
commit 340b5eede7
19 changed files with 197 additions and 36 deletions
+4 -5
View File
@@ -6,6 +6,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import { assert } from './misc';
import { Target } from './target';
export class Writer {
@@ -50,12 +51,10 @@ export class Writer {
/** Called after muxing has finished. */
async finalize() {
await this.target._finalize();
}
assert(this.target._output);
/** Closes the writer. */
async close() {
return this.target._close();
await this.target._finalize();
this.target._output._targets.delete(this.target);
}
private trackedWrites: Uint8Array | null = null;