mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-10-03 22:03:49 +02:00
Fix HLS writing an incomplete init segment for sparse segments, improve decoder config validation, fix getFirstTimestamp() for Inputs with zero-packet tracks, allow zero-track muxing for some formats that allow it, add new track metadata that allows you to specify the decoder config early (enables zero-packet tracks), fix trafIndices in sparse fragmented MP4s, fix assertion errors in MPEG-TS demuxer
This commit is contained in:
@@ -64,7 +64,7 @@ export class AdtsMuxer extends Muxer {
|
||||
|
||||
// First packet - determine input format from metadata
|
||||
if (this.inputIsAdts === null) {
|
||||
validateAudioChunkMetadata(meta);
|
||||
validateAudioChunkMetadata(meta, track.source._codec);
|
||||
|
||||
const description = meta?.decoderConfig?.description;
|
||||
|
||||
@@ -119,6 +119,11 @@ export class AdtsMuxer extends Muxer {
|
||||
|
||||
async finalize() {
|
||||
const release = await this.mutex.acquire(); // Required so that finalize() can't resolve before other calls
|
||||
|
||||
if (this.inputIsAdts === null) {
|
||||
throw new Error('Cannot finalize an empty ADTS file: not a single packet was added.');
|
||||
}
|
||||
|
||||
release();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user