mirror of
https://github.com/video-dev/hls.js.git
synced 2026-06-16 13:34:44 +00:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user