mediabunny 1.40.0 → 1.40.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11726,7 +11726,9 @@ var Mediabunny = (() => {
11726
11726
  defaultDuration: null,
11727
11727
  defaultDurationNs: null,
11728
11728
  name: null,
11729
- languageCode: UNDETERMINED_LANGUAGE,
11729
+ languageCode: "eng",
11730
+ // The default in Matroska
11731
+ hasLanguageBcp47: false,
11730
11732
  decodingInstructions: [],
11731
11733
  info: null
11732
11734
  };
@@ -11776,7 +11778,7 @@ var Mediabunny = (() => {
11776
11778
  const inputTrack = new InputVideoTrack(this.input, new MatroskaVideoTrackBacking(videoTrack));
11777
11779
  this.currentTrack.inputTrack = inputTrack;
11778
11780
  this.currentSegment.tracks.push(this.currentTrack);
11779
- } else if (this.currentTrack.info.type === "audio" && this.currentTrack.info.numberOfChannels !== -1 && this.currentTrack.info.sampleRate !== -1) {
11781
+ } else if (this.currentTrack.info.type === "audio") {
11780
11782
  if (codecIdWithoutSuffix === CODEC_STRING_MAP.aac) {
11781
11783
  this.currentTrack.info.codec = "aac";
11782
11784
  this.currentTrack.info.aacCodecInfo = {
@@ -11869,8 +11871,10 @@ var Mediabunny = (() => {
11869
11871
  } else if (type === 2) {
11870
11872
  this.currentTrack.info = {
11871
11873
  type: "audio",
11872
- numberOfChannels: -1,
11873
- sampleRate: -1,
11874
+ numberOfChannels: 1,
11875
+ // Default value
11876
+ sampleRate: 8e3,
11877
+ // Default value
11874
11878
  bitDepth: -1,
11875
11879
  codec: null,
11876
11880
  codecDescription: null,
@@ -11963,7 +11967,7 @@ var Mediabunny = (() => {
11963
11967
  case 2274716 /* Language */:
11964
11968
  {
11965
11969
  if (!this.currentTrack) break;
11966
- if (this.currentTrack.languageCode !== UNDETERMINED_LANGUAGE) {
11970
+ if (this.currentTrack.hasLanguageBcp47) {
11967
11971
  break;
11968
11972
  }
11969
11973
  this.currentTrack.languageCode = readAsciiString(slice, size);
@@ -11983,6 +11987,7 @@ var Mediabunny = (() => {
11983
11987
  } else {
11984
11988
  this.currentTrack.languageCode = UNDETERMINED_LANGUAGE;
11985
11989
  }
11990
+ this.currentTrack.hasLanguageBcp47 = true;
11986
11991
  }
11987
11992
  ;
11988
11993
  break;