mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-09-28 03:13:51 +02:00
Merge branch 'main' into hls
This commit is contained in:
@@ -786,6 +786,12 @@ export class Conversion {
|
||||
+ ' for encoding and decoding AC-3/E-AC-3.',
|
||||
);
|
||||
}
|
||||
|
||||
if (codecs.includes('flac')) {
|
||||
elements.push(
|
||||
'\nThe @mediabunny/flac-encoder extension package provides support for encoding FLAC.',
|
||||
);
|
||||
}
|
||||
} else {
|
||||
elements.push('\nCheck the discardedTracks field for more info.');
|
||||
}
|
||||
|
||||
+8
-12
@@ -207,12 +207,6 @@ export class FlacMuxer extends Muxer {
|
||||
): Promise<void> {
|
||||
const release = await this.mutex.acquire();
|
||||
|
||||
validateAudioChunkMetadata(meta);
|
||||
|
||||
assert(meta);
|
||||
assert(meta.decoderConfig);
|
||||
assert(meta.decoderConfig.description);
|
||||
|
||||
try {
|
||||
this.validateAndNormalizeTimestamp(
|
||||
track,
|
||||
@@ -221,14 +215,16 @@ export class FlacMuxer extends Muxer {
|
||||
);
|
||||
|
||||
if (this.sampleRate === null) {
|
||||
// It's the first packet
|
||||
validateAudioChunkMetadata(meta);
|
||||
|
||||
assert(meta);
|
||||
assert(meta.decoderConfig);
|
||||
assert(meta.decoderConfig.description);
|
||||
|
||||
this.sampleRate = meta.decoderConfig.sampleRate;
|
||||
}
|
||||
|
||||
if (this.channels === null) {
|
||||
this.channels = meta.decoderConfig.numberOfChannels;
|
||||
}
|
||||
|
||||
if (this.bitsPerSample === null) {
|
||||
const descriptionBitstream = new Bitstream(
|
||||
toUint8Array(meta.decoderConfig.description),
|
||||
);
|
||||
@@ -244,7 +240,7 @@ export class FlacMuxer extends Muxer {
|
||||
}
|
||||
|
||||
const slice = FileSlice.tempFromBytes(packet.data);
|
||||
readBytes(slice, 2);
|
||||
slice.skip(2);
|
||||
const bytes = readBytes(slice, 2);
|
||||
const bitstream = new Bitstream(bytes);
|
||||
const blockSizeOrUncommon = getBlockSizeOrUncommon(bitstream.readBits(4));
|
||||
|
||||
Reference in New Issue
Block a user