mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-10-02 21:33:52 +02:00
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:
@@ -2558,7 +2558,7 @@ abstract class IsobmffTrackBacking implements InputTrackBacking {
|
||||
return this.internalTrack.timescale;
|
||||
}
|
||||
|
||||
getTimestampsAreRelativeToUnixEpoch() {
|
||||
isRelativeToUnixEpoch() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ import {
|
||||
import { Muxer } from '../muxer';
|
||||
import { Output, OutputAudioTrack, OutputSubtitleTrack, OutputTrack, OutputVideoTrack } from '../output';
|
||||
import { Writer } from '../writer';
|
||||
import { BufferTarget, Target } from '../target';
|
||||
import { BufferTarget } from '../target';
|
||||
import { assert, computeRationalApproximation, last, promiseWithResolvers, Rational, simplifyRational } from '../misc';
|
||||
import { IsobmffOutputFormatOptions, IsobmffOutputFormat, MovOutputFormat, CmafOutputFormat } from '../output-format';
|
||||
import { inlineTimestampRegex, SubtitleConfig, SubtitleCue, SubtitleMetadata } from '../subtitles';
|
||||
@@ -228,7 +228,7 @@ export class IsobmffMuxer extends Muxer {
|
||||
}
|
||||
|
||||
if (this.isCmaf) {
|
||||
if (this.output._initTarget === null) {
|
||||
if (!this.output._hasInitTarget()) {
|
||||
throw new Error(
|
||||
`CMAF outputs require the initTarget field in OutputOptions to be set; the init segment`
|
||||
+ ` will be written to it.`,
|
||||
@@ -236,9 +236,7 @@ export class IsobmffMuxer extends Muxer {
|
||||
}
|
||||
|
||||
// Set up the init writer to which we'll write the init segment
|
||||
const initTarget = this.output._initTarget instanceof Target
|
||||
? this.output._initTarget
|
||||
: await this.output._initTarget();
|
||||
const initTarget = await this.output._getInitTarget();
|
||||
const initWriter = new Writer(initTarget);
|
||||
initWriter.start();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user