Error and switch on containerless EC-3

Fixes #4958 in Safari where EC-3 playback is supported, but hls.js ec-3 audio demuxer not implemented
This commit is contained in:
Rob Walch
2026-05-26 10:21:58 -07:00
committed by Rob Walch
parent 9baf59ec96
commit 971727cd12
2 changed files with 16 additions and 8 deletions
+8 -4
View File
@@ -72,11 +72,15 @@ export class AC3Demuxer extends BaseAudioDemuxer {
if (
data[offset] === 0x0b &&
data[offset + 1] === 0x77 &&
getId3Timestamp(id3Data) !== undefined &&
// check the bsid to confirm ac-3
getAudioBSID(data, offset) < 16
getId3Timestamp(id3Data) !== undefined
) {
return true;
// check the bsid to confirm ac-3
const bsid = getAudioBSID(data, offset);
if (bsid < 16) {
return true;
} else {
throw new Error('Containerless ec-3 is not supported');
}
}
return false;
}
+8 -4
View File
@@ -468,11 +468,15 @@ export default class Transmuxer {
}
// probe for content type
let mux: MuxConfig | undefined;
for (let i = 0, len = muxConfig.length; i < len; i++) {
if (muxConfig[i].demux?.probe(data, this.logger)) {
mux = muxConfig[i];
break;
try {
for (let i = 0, len = muxConfig.length; i < len; i++) {
if (muxConfig[i].demux?.probe(data, this.logger)) {
mux = muxConfig[i];
break;
}
}
} catch (error) {
return error;
}
if (!mux) {
return new Error('Failed to find demuxer by probing fragment data');