mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-09-30 04:13:51 +02:00
Merge branch 'main' into hls
This commit is contained in:
@@ -197,6 +197,7 @@ type InternalTrack = {
|
||||
defaultDurationNs: number | null;
|
||||
name: string | null;
|
||||
languageCode: string;
|
||||
hasLanguageBcp47: boolean;
|
||||
decodingInstructions: DecodingInstruction[];
|
||||
|
||||
info:
|
||||
@@ -1025,7 +1026,8 @@ export class MatroskaDemuxer extends Demuxer {
|
||||
defaultDuration: null,
|
||||
defaultDurationNs: null,
|
||||
name: null,
|
||||
languageCode: UNDETERMINED_LANGUAGE,
|
||||
languageCode: 'eng', // The default in Matroska
|
||||
hasLanguageBcp47: false,
|
||||
decodingInstructions: [],
|
||||
|
||||
info: null,
|
||||
@@ -1102,11 +1104,7 @@ export class MatroskaDemuxer extends Demuxer {
|
||||
const inputTrack = new InputVideoTrack(this.input, new MatroskaVideoTrackBacking(videoTrack));
|
||||
this.currentTrack.inputTrack = inputTrack;
|
||||
this.currentSegment.tracks.push(this.currentTrack);
|
||||
} else if (
|
||||
this.currentTrack.info.type === 'audio'
|
||||
&& this.currentTrack.info.numberOfChannels !== -1
|
||||
&& this.currentTrack.info.sampleRate !== -1
|
||||
) {
|
||||
} else if (this.currentTrack.info.type === 'audio') {
|
||||
if (codecIdWithoutSuffix === CODEC_STRING_MAP.aac) {
|
||||
this.currentTrack.info.codec = 'aac';
|
||||
this.currentTrack.info.aacCodecInfo = {
|
||||
@@ -1199,8 +1197,8 @@ export class MatroskaDemuxer extends Demuxer {
|
||||
} else if (type === 2) {
|
||||
this.currentTrack.info = {
|
||||
type: 'audio',
|
||||
numberOfChannels: -1,
|
||||
sampleRate: -1,
|
||||
numberOfChannels: 1, // Default value
|
||||
sampleRate: 8000, // Default value
|
||||
bitDepth: -1,
|
||||
codec: null,
|
||||
codecDescription: null,
|
||||
@@ -1279,7 +1277,7 @@ export class MatroskaDemuxer extends Demuxer {
|
||||
|
||||
case EBMLId.Language: {
|
||||
if (!this.currentTrack) break;
|
||||
if (this.currentTrack.languageCode !== UNDETERMINED_LANGUAGE) {
|
||||
if (this.currentTrack.hasLanguageBcp47) {
|
||||
// LanguageBCP47 was present, which takes precedence
|
||||
break;
|
||||
}
|
||||
@@ -1306,6 +1304,8 @@ export class MatroskaDemuxer extends Demuxer {
|
||||
} else {
|
||||
this.currentTrack.languageCode = UNDETERMINED_LANGUAGE;
|
||||
}
|
||||
|
||||
this.currentTrack.hasLanguageBcp47 = true;
|
||||
}; break;
|
||||
|
||||
case EBMLId.Video: {
|
||||
|
||||
Reference in New Issue
Block a user