@remotion/media-parser 4.0.533 → 4.0.535

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.
@@ -3080,8 +3080,8 @@ var parseAv1PrivateData = (data, colrAtom) => {
3080
3080
  str += ".";
3081
3081
  const high_bitdepth = iterator.getBits(1);
3082
3082
  const twelve_bit = iterator.getBits(1);
3083
- const bitDepth2 = high_bitdepth && seqProfile === 2 ? twelve_bit ? 12 : 10 : high_bitdepth ? 10 : 8;
3084
- str += bitDepth2.toString().padStart(2, "0");
3083
+ const bitDepth = high_bitdepth && seqProfile === 2 ? twelve_bit ? 12 : 10 : high_bitdepth ? 10 : 8;
3084
+ str += bitDepth.toString().padStart(2, "0");
3085
3085
  str += ".";
3086
3086
  const mono_chrome = iterator.getBits(1);
3087
3087
  str += mono_chrome ? "1" : "0";
@@ -3198,12 +3198,12 @@ var normalizeVideoRotation = (rotation) => {
3198
3198
  var WEBCODECS_TIMESCALE = 1e6;
3199
3199
 
3200
3200
  // src/containers/iso-base-media/color-to-webcodecs-colors.ts
3201
- var mediaParserAdvancedColorToWebCodecsColor = (color2) => {
3201
+ var mediaParserAdvancedColorToWebCodecsColor = (color) => {
3202
3202
  return {
3203
- transfer: color2.transfer,
3204
- matrix: color2.matrix,
3205
- primaries: color2.primaries,
3206
- fullRange: color2.fullRange
3203
+ transfer: color.transfer,
3204
+ matrix: color.matrix,
3205
+ primaries: color.primaries,
3206
+ fullRange: color.fullRange
3207
3207
  };
3208
3208
  };
3209
3209
 
@@ -3286,10 +3286,10 @@ var createAacCodecPrivate = ({
3286
3286
  audioObjectType,
3287
3287
  sampleRate,
3288
3288
  channelConfiguration,
3289
- codecPrivate: codecPrivate2
3289
+ codecPrivate
3290
3290
  }) => {
3291
- if (codecPrivate2 !== null && codecPrivate2.length > 2) {
3292
- return codecPrivate2;
3291
+ if (codecPrivate !== null && codecPrivate.length > 2) {
3292
+ return codecPrivate;
3293
3293
  }
3294
3294
  const bits = `${audioObjectType.toString(2).padStart(5, "0")}${getConfigForSampleRate(sampleRate).toString(2).padStart(4, "0")}${channelConfiguration.toString(2).padStart(4, "0")}000`;
3295
3295
  if (bits.length !== 16) {
@@ -3361,7 +3361,7 @@ var mapAudioObjectTypeToCodecString = (audioObjectType) => {
3361
3361
  // src/containers/iso-base-media/get-actual-number-of-channels.ts
3362
3362
  var getActualDecoderParameters = ({
3363
3363
  audioCodec,
3364
- codecPrivate: codecPrivate2,
3364
+ codecPrivate,
3365
3365
  numberOfChannels,
3366
3366
  sampleRate
3367
3367
  }) => {
@@ -3369,19 +3369,19 @@ var getActualDecoderParameters = ({
3369
3369
  return {
3370
3370
  numberOfChannels,
3371
3371
  sampleRate,
3372
- codecPrivate: codecPrivate2
3372
+ codecPrivate
3373
3373
  };
3374
3374
  }
3375
- if (codecPrivate2 === null) {
3376
- return { numberOfChannels, sampleRate, codecPrivate: codecPrivate2 };
3375
+ if (codecPrivate === null) {
3376
+ return { numberOfChannels, sampleRate, codecPrivate };
3377
3377
  }
3378
- if (codecPrivate2.type !== "aac-config") {
3378
+ if (codecPrivate.type !== "aac-config") {
3379
3379
  throw new Error("Expected AAC codec private data");
3380
3380
  }
3381
- const parsed = parseAacCodecPrivate(codecPrivate2.data);
3381
+ const parsed = parseAacCodecPrivate(codecPrivate.data);
3382
3382
  const actual = createAacCodecPrivate({
3383
3383
  ...parsed,
3384
- codecPrivate: codecPrivate2.data
3384
+ codecPrivate: codecPrivate.data
3385
3385
  });
3386
3386
  return {
3387
3387
  numberOfChannels: parsed.channelConfiguration,
@@ -3497,11 +3497,11 @@ var makeBaseMediaTrack = (trakBox, startTimeInSeconds) => {
3497
3497
  throw new Error("Could not find sample rate");
3498
3498
  }
3499
3499
  const { codecString, description } = getAudioCodecStringFromTrak(trakBox);
3500
- const codecPrivate2 = getCodecPrivateFromTrak(trakBox) ?? description ?? null;
3500
+ const codecPrivate = getCodecPrivateFromTrak(trakBox) ?? description ?? null;
3501
3501
  const codecEnum = getAudioCodecFromTrack(trakBox);
3502
3502
  const actual = getActualDecoderParameters({
3503
3503
  audioCodec: codecEnum,
3504
- codecPrivate: codecPrivate2 ?? null,
3504
+ codecPrivate: codecPrivate ?? null,
3505
3505
  numberOfChannels,
3506
3506
  sampleRate
3507
3507
  });
@@ -3740,7 +3740,7 @@ var makeAviVideoTrack = ({
3740
3740
  };
3741
3741
  };
3742
3742
  var getTracksFromAvi = (structure, state) => {
3743
- const tracks2 = [];
3743
+ const tracks = [];
3744
3744
  const boxes = getStrlBoxes(structure);
3745
3745
  let i = 0;
3746
3746
  for (const box of boxes) {
@@ -3750,22 +3750,22 @@ var getTracksFromAvi = (structure, state) => {
3750
3750
  }
3751
3751
  const { strf } = strh;
3752
3752
  if (strf.type === "strf-box-video") {
3753
- tracks2.push(addAvcProfileToTrack(makeAviVideoTrack({ strh, strf, index: i }), state.riff.getAvcProfile()));
3753
+ tracks.push(addAvcProfileToTrack(makeAviVideoTrack({ strh, strf, index: i }), state.riff.getAvcProfile()));
3754
3754
  } else if (strh.fccType === "auds") {
3755
- tracks2.push(makeAviAudioTrack({ strf, index: i }));
3755
+ tracks.push(makeAviAudioTrack({ strf, index: i }));
3756
3756
  } else {
3757
3757
  throw new Error(`Unsupported track type ${strh.fccType}`);
3758
3758
  }
3759
3759
  i++;
3760
3760
  }
3761
- return tracks2;
3761
+ return tracks;
3762
3762
  };
3763
3763
  var hasAllTracksFromAvi = (state) => {
3764
3764
  try {
3765
3765
  const structure = state.structure.getRiffStructure();
3766
3766
  const numberOfTracks = getNumberOfTracks(structure);
3767
- const tracks2 = getTracksFromAvi(structure, state);
3768
- return tracks2.length === numberOfTracks && !tracks2.find((t) => t.type === "video" && t.codec === TO_BE_OVERRIDDEN_LATER);
3767
+ const tracks = getTracksFromAvi(structure, state);
3768
+ return tracks.length === numberOfTracks && !tracks.find((t) => t.type === "video" && t.codec === TO_BE_OVERRIDDEN_LATER);
3769
3769
  } catch {
3770
3770
  return false;
3771
3771
  }
@@ -3896,106 +3896,106 @@ var getCodecSegment = (track) => {
3896
3896
  return codec;
3897
3897
  };
3898
3898
  var getColourSegment = (track) => {
3899
- const videoSegment2 = getVideoSegment(track);
3900
- if (!videoSegment2) {
3899
+ const videoSegment = getVideoSegment(track);
3900
+ if (!videoSegment) {
3901
3901
  return null;
3902
3902
  }
3903
- const colour = videoSegment2.value.find((b) => b.type === "Colour");
3903
+ const colour = videoSegment.value.find((b) => b.type === "Colour");
3904
3904
  if (!colour || colour.type !== "Colour") {
3905
3905
  return null;
3906
3906
  }
3907
3907
  return colour;
3908
3908
  };
3909
- var getTransferCharacteristicsSegment = (color2) => {
3910
- if (!color2 || color2.type !== "Colour") {
3909
+ var getTransferCharacteristicsSegment = (color) => {
3910
+ if (!color || color.type !== "Colour") {
3911
3911
  return null;
3912
3912
  }
3913
- const box = color2.value.find((b) => b.type === "TransferCharacteristics");
3913
+ const box = color.value.find((b) => b.type === "TransferCharacteristics");
3914
3914
  if (!box || box.type !== "TransferCharacteristics") {
3915
3915
  return null;
3916
3916
  }
3917
3917
  return box;
3918
3918
  };
3919
- var getMatrixCoefficientsSegment = (color2) => {
3920
- if (!color2 || color2.type !== "Colour") {
3919
+ var getMatrixCoefficientsSegment = (color) => {
3920
+ if (!color || color.type !== "Colour") {
3921
3921
  return null;
3922
3922
  }
3923
- const box = color2.value.find((b) => b.type === "MatrixCoefficients");
3923
+ const box = color.value.find((b) => b.type === "MatrixCoefficients");
3924
3924
  if (!box || box.type !== "MatrixCoefficients") {
3925
3925
  return null;
3926
3926
  }
3927
3927
  return box;
3928
3928
  };
3929
- var getPrimariesSegment = (color2) => {
3930
- if (!color2 || color2.type !== "Colour") {
3929
+ var getPrimariesSegment = (color) => {
3930
+ if (!color || color.type !== "Colour") {
3931
3931
  return null;
3932
3932
  }
3933
- const box = color2.value.find((b) => b.type === "Primaries");
3933
+ const box = color.value.find((b) => b.type === "Primaries");
3934
3934
  if (!box || box.type !== "Primaries") {
3935
3935
  return null;
3936
3936
  }
3937
3937
  return box;
3938
3938
  };
3939
- var getRangeSegment = (color2) => {
3940
- if (!color2 || color2.type !== "Colour") {
3939
+ var getRangeSegment = (color) => {
3940
+ if (!color || color.type !== "Colour") {
3941
3941
  return null;
3942
3942
  }
3943
- const box = color2.value.find((b) => b.type === "Range");
3943
+ const box = color.value.find((b) => b.type === "Range");
3944
3944
  if (!box || box.type !== "Range") {
3945
3945
  return null;
3946
3946
  }
3947
3947
  return box;
3948
3948
  };
3949
3949
  var getDisplayHeightSegment = (track) => {
3950
- const videoSegment2 = getVideoSegment(track);
3951
- if (!videoSegment2) {
3950
+ const videoSegment = getVideoSegment(track);
3951
+ if (!videoSegment) {
3952
3952
  return null;
3953
3953
  }
3954
- const displayHeight2 = videoSegment2.value.find((b) => b.type === "DisplayHeight");
3955
- if (!displayHeight2 || displayHeight2.type !== "DisplayHeight") {
3954
+ const displayHeight = videoSegment.value.find((b) => b.type === "DisplayHeight");
3955
+ if (!displayHeight || displayHeight.type !== "DisplayHeight") {
3956
3956
  return null;
3957
3957
  }
3958
- return displayHeight2;
3958
+ return displayHeight;
3959
3959
  };
3960
3960
  var getTrackTypeSegment = (track) => {
3961
- const trackType2 = track.value.find((b) => b.type === "TrackType");
3962
- if (!trackType2 || trackType2.type !== "TrackType") {
3961
+ const trackType = track.value.find((b) => b.type === "TrackType");
3962
+ if (!trackType || trackType.type !== "TrackType") {
3963
3963
  return null;
3964
3964
  }
3965
- return trackType2;
3965
+ return trackType;
3966
3966
  };
3967
3967
  var getWidthSegment = (track) => {
3968
- const videoSegment2 = getVideoSegment(track);
3969
- if (!videoSegment2) {
3968
+ const videoSegment = getVideoSegment(track);
3969
+ if (!videoSegment) {
3970
3970
  return null;
3971
3971
  }
3972
- const width = videoSegment2.value.find((b) => b.type === "PixelWidth");
3972
+ const width = videoSegment.value.find((b) => b.type === "PixelWidth");
3973
3973
  if (!width || width.type !== "PixelWidth") {
3974
3974
  return null;
3975
3975
  }
3976
3976
  return width;
3977
3977
  };
3978
3978
  var getHeightSegment = (track) => {
3979
- const videoSegment2 = getVideoSegment(track);
3980
- if (!videoSegment2) {
3979
+ const videoSegment = getVideoSegment(track);
3980
+ if (!videoSegment) {
3981
3981
  return null;
3982
3982
  }
3983
- const height = videoSegment2.value.find((b) => b.type === "PixelHeight");
3983
+ const height = videoSegment.value.find((b) => b.type === "PixelHeight");
3984
3984
  if (!height || height.type !== "PixelHeight") {
3985
3985
  return null;
3986
3986
  }
3987
3987
  return height;
3988
3988
  };
3989
3989
  var getDisplayWidthSegment = (track) => {
3990
- const videoSegment2 = getVideoSegment(track);
3991
- if (!videoSegment2) {
3990
+ const videoSegment = getVideoSegment(track);
3991
+ if (!videoSegment) {
3992
3992
  return null;
3993
3993
  }
3994
- const displayWidth2 = videoSegment2.value.find((b) => b.type === "DisplayWidth");
3995
- if (!displayWidth2 || displayWidth2.type !== "DisplayWidth") {
3994
+ const displayWidth = videoSegment.value.find((b) => b.type === "DisplayWidth");
3995
+ if (!displayWidth || displayWidth.type !== "DisplayWidth") {
3996
3996
  return null;
3997
3997
  }
3998
- return displayWidth2;
3998
+ return displayWidth;
3999
3999
  };
4000
4000
  var getTracksSegment = (segment) => {
4001
4001
  const tracksSegment = segment.value.find((b) => b.type === "Tracks");
@@ -4010,60 +4010,60 @@ var getTrackWithUid = (segment, trackUid) => {
4010
4010
  return null;
4011
4011
  }
4012
4012
  const trackEntries = tracksSegment.value.filter((t) => t.type === "TrackEntry");
4013
- const trackEntry2 = trackEntries.find((entry) => {
4013
+ const trackEntry = trackEntries.find((entry) => {
4014
4014
  return entry?.value.find((t) => t.type === "TrackUID" && t.value === trackUid);
4015
4015
  });
4016
- if (!trackEntry2) {
4016
+ if (!trackEntry) {
4017
4017
  return null;
4018
4018
  }
4019
- return trackEntry2.value.find((t) => t.type === "TrackNumber")?.value.value ?? null;
4019
+ return trackEntry.value.find((t) => t.type === "TrackNumber")?.value.value ?? null;
4020
4020
  };
4021
4021
  var getVideoSegment = (track) => {
4022
- const videoSegment2 = track.value.find((b) => b.type === "Video");
4023
- if (!videoSegment2 || videoSegment2.type !== "Video") {
4022
+ const videoSegment = track.value.find((b) => b.type === "Video");
4023
+ if (!videoSegment || videoSegment.type !== "Video") {
4024
4024
  return null;
4025
4025
  }
4026
- return videoSegment2 ?? null;
4026
+ return videoSegment ?? null;
4027
4027
  };
4028
4028
  var getAudioSegment = (track) => {
4029
- const audioSegment2 = track.value.find((b) => b.type === "Audio");
4030
- if (!audioSegment2 || audioSegment2.type !== "Audio") {
4029
+ const audioSegment = track.value.find((b) => b.type === "Audio");
4030
+ if (!audioSegment || audioSegment.type !== "Audio") {
4031
4031
  return null;
4032
4032
  }
4033
- return audioSegment2 ?? null;
4033
+ return audioSegment ?? null;
4034
4034
  };
4035
4035
  var getSampleRate2 = (track) => {
4036
- const audioSegment2 = getAudioSegment(track);
4037
- if (!audioSegment2) {
4036
+ const audioSegment = getAudioSegment(track);
4037
+ if (!audioSegment) {
4038
4038
  return null;
4039
4039
  }
4040
- const samplingFrequency2 = audioSegment2.value.find((b) => b.type === "SamplingFrequency");
4041
- if (!samplingFrequency2 || samplingFrequency2.type !== "SamplingFrequency") {
4040
+ const samplingFrequency = audioSegment.value.find((b) => b.type === "SamplingFrequency");
4041
+ if (!samplingFrequency || samplingFrequency.type !== "SamplingFrequency") {
4042
4042
  return null;
4043
4043
  }
4044
- return samplingFrequency2.value.value;
4044
+ return samplingFrequency.value.value;
4045
4045
  };
4046
4046
  var getNumberOfChannels = (track) => {
4047
- const audioSegment2 = getAudioSegment(track);
4048
- if (!audioSegment2) {
4047
+ const audioSegment = getAudioSegment(track);
4048
+ if (!audioSegment) {
4049
4049
  throw new Error("Could not find audio segment");
4050
4050
  }
4051
- const channels2 = audioSegment2.value.find((b) => b.type === "Channels");
4052
- if (!channels2 || channels2.type !== "Channels") {
4051
+ const channels = audioSegment.value.find((b) => b.type === "Channels");
4052
+ if (!channels || channels.type !== "Channels") {
4053
4053
  return 1;
4054
4054
  }
4055
- return channels2.value.value;
4055
+ return channels.value.value;
4056
4056
  };
4057
4057
  var getBitDepth = (track) => {
4058
- const audioSegment2 = getAudioSegment(track);
4059
- if (!audioSegment2) {
4058
+ const audioSegment = getAudioSegment(track);
4059
+ if (!audioSegment) {
4060
4060
  return null;
4061
4061
  }
4062
- const bitDepth2 = audioSegment2.value.find((b) => b.type === "BitDepth");
4063
- if (!bitDepth2 || bitDepth2.type !== "BitDepth") {
4062
+ const bitDepth = audioSegment.value.find((b) => b.type === "BitDepth");
4063
+ if (!bitDepth || bitDepth.type !== "BitDepth") {
4064
4064
  return null;
4065
4065
  }
4066
- return bitDepth2.value.value;
4066
+ return bitDepth.value.value;
4067
4067
  };
4068
4068
  var getPrivateData = (track) => {
4069
4069
  const privateData = track.value.find((b) => b.type === "CodecPrivate");
@@ -4075,15 +4075,15 @@ var getPrivateData = (track) => {
4075
4075
 
4076
4076
  // src/containers/webm/color.ts
4077
4077
  var parseColorSegment = (colourSegment) => {
4078
- const transferCharacteristics2 = getTransferCharacteristicsSegment(colourSegment);
4079
- const matrixCoefficients2 = getMatrixCoefficientsSegment(colourSegment);
4080
- const primaries2 = getPrimariesSegment(colourSegment);
4081
- const range2 = getRangeSegment(colourSegment);
4078
+ const transferCharacteristics = getTransferCharacteristicsSegment(colourSegment);
4079
+ const matrixCoefficients = getMatrixCoefficientsSegment(colourSegment);
4080
+ const primaries = getPrimariesSegment(colourSegment);
4081
+ const range = getRangeSegment(colourSegment);
4082
4082
  return {
4083
- transfer: transferCharacteristics2 ? getTransferCharacteristicsFromIndex(transferCharacteristics2.value.value) : null,
4084
- matrix: matrixCoefficients2 ? getMatrixCoefficientsFromIndex(matrixCoefficients2.value.value) : null,
4085
- primaries: primaries2 ? getPrimariesFromIndex(primaries2.value.value) : null,
4086
- fullRange: transferCharacteristics2?.value.value && matrixCoefficients2?.value.value ? null : range2 ? Boolean(range2?.value.value) : null
4083
+ transfer: transferCharacteristics ? getTransferCharacteristicsFromIndex(transferCharacteristics.value.value) : null,
4084
+ matrix: matrixCoefficients ? getMatrixCoefficientsFromIndex(matrixCoefficients.value.value) : null,
4085
+ primaries: primaries ? getPrimariesFromIndex(primaries.value.value) : null,
4086
+ fullRange: transferCharacteristics?.value.value && matrixCoefficients?.value.value ? null : range ? Boolean(range?.value.value) : null
4087
4087
  };
4088
4088
  };
4089
4089
 
@@ -4153,8 +4153,8 @@ var getAudioDescription = (track) => {
4153
4153
  };
4154
4154
 
4155
4155
  // src/containers/webm/segments/track-entry.ts
4156
- var trackTypeToString = (trackType2) => {
4157
- switch (trackType2) {
4156
+ var trackTypeToString = (trackType) => {
4157
+ switch (trackType) {
4158
4158
  case 1:
4159
4159
  return "video";
4160
4160
  case 2:
@@ -4170,7 +4170,7 @@ var trackTypeToString = (trackType2) => {
4170
4170
  case 7:
4171
4171
  return "metadata";
4172
4172
  default:
4173
- throw new Error(`Unknown track type: ${trackType2}`);
4173
+ throw new Error(`Unknown track type: ${trackType}`);
4174
4174
  }
4175
4175
  };
4176
4176
 
@@ -4262,17 +4262,17 @@ var getMatroskaAudioCodecEnum = ({
4262
4262
  return "vorbis";
4263
4263
  }
4264
4264
  if (codec.value === "A_PCM/INT/LIT") {
4265
- const bitDepth2 = getBitDepth(track);
4266
- if (bitDepth2 === null) {
4265
+ const bitDepth = getBitDepth(track);
4266
+ if (bitDepth === null) {
4267
4267
  throw new Error("Expected bit depth");
4268
4268
  }
4269
- if (bitDepth2 === 8) {
4269
+ if (bitDepth === 8) {
4270
4270
  return "pcm-u8";
4271
4271
  }
4272
- if (bitDepth2 === 16) {
4272
+ if (bitDepth === 16) {
4273
4273
  return "pcm-s16";
4274
4274
  }
4275
- if (bitDepth2 === 24) {
4275
+ if (bitDepth === 24) {
4276
4276
  return "pcm-s24";
4277
4277
  }
4278
4278
  throw new Error("Unknown audio format");
@@ -4297,14 +4297,14 @@ var getMatroskaAudioCodecString = (track) => {
4297
4297
  return "vorbis";
4298
4298
  }
4299
4299
  if (codec.value === "A_PCM/INT/LIT") {
4300
- const bitDepth2 = getBitDepth(track);
4301
- if (bitDepth2 === null) {
4300
+ const bitDepth = getBitDepth(track);
4301
+ if (bitDepth === null) {
4302
4302
  throw new Error("Expected bit depth");
4303
4303
  }
4304
- if (bitDepth2 === 8) {
4304
+ if (bitDepth === 8) {
4305
4305
  return "pcm-u8";
4306
4306
  }
4307
- return "pcm-s" + bitDepth2;
4307
+ return "pcm-s" + bitDepth;
4308
4308
  }
4309
4309
  if (codec.value === "A_AAC") {
4310
4310
  const priv = getPrivateData(track);
@@ -4328,12 +4328,12 @@ var getTrack = ({
4328
4328
  timescale,
4329
4329
  track
4330
4330
  }) => {
4331
- const trackType2 = getTrackTypeSegment(track);
4332
- if (!trackType2) {
4331
+ const trackType = getTrackTypeSegment(track);
4332
+ if (!trackType) {
4333
4333
  throw new Error("Expected track type segment");
4334
4334
  }
4335
4335
  const trackId = getTrackId(track);
4336
- if (trackTypeToString(trackType2.value.value) === "video") {
4336
+ if (trackTypeToString(trackType.value.value) === "video") {
4337
4337
  const width = getWidthSegment(track);
4338
4338
  if (width === null) {
4339
4339
  throw new Error("Expected width segment");
@@ -4342,13 +4342,13 @@ var getTrack = ({
4342
4342
  if (height === null) {
4343
4343
  throw new Error("Expected height segment");
4344
4344
  }
4345
- const displayHeight2 = getDisplayHeightSegment(track);
4346
- const displayWidth2 = getDisplayWidthSegment(track);
4345
+ const displayHeight = getDisplayHeightSegment(track);
4346
+ const displayWidth = getDisplayWidthSegment(track);
4347
4347
  const codec = getCodecSegment(track);
4348
4348
  if (!codec) {
4349
4349
  return null;
4350
4350
  }
4351
- const codecPrivate2 = getPrivateData(track);
4351
+ const codecPrivate = getPrivateData(track);
4352
4352
  const codecString = getMatroskaVideoCodecString({
4353
4353
  track,
4354
4354
  codecSegment: codec
@@ -4360,18 +4360,18 @@ var getTrack = ({
4360
4360
  const codecEnum = getMatroskaVideoCodecEnum({
4361
4361
  codecSegment: codec
4362
4362
  });
4363
- const codecData = codecPrivate2 === null ? null : codecEnum === "h264" ? { type: "avc-sps-pps", data: codecPrivate2 } : codecEnum === "av1" ? {
4363
+ const codecData = codecPrivate === null ? null : codecEnum === "h264" ? { type: "avc-sps-pps", data: codecPrivate } : codecEnum === "av1" ? {
4364
4364
  type: "av1c-data",
4365
- data: codecPrivate2
4365
+ data: codecPrivate
4366
4366
  } : codecEnum === "h265" ? {
4367
4367
  type: "hvcc-data",
4368
- data: codecPrivate2
4368
+ data: codecPrivate
4369
4369
  } : codecEnum === "vp8" ? {
4370
4370
  type: "unknown-data",
4371
- data: codecPrivate2
4371
+ data: codecPrivate
4372
4372
  } : codecEnum === "vp9" ? {
4373
4373
  type: "unknown-data",
4374
- data: codecPrivate2
4374
+ data: codecPrivate
4375
4375
  } : null;
4376
4376
  const advancedColor = colour ? parseColorSegment(colour) : {
4377
4377
  fullRange: null,
@@ -4385,8 +4385,8 @@ var getTrack = ({
4385
4385
  trackId,
4386
4386
  codec: codecString,
4387
4387
  description: getDescription(track),
4388
- height: displayHeight2 ? displayHeight2.value.value : height.value.value,
4389
- width: displayWidth2 ? displayWidth2.value.value : width.value.value,
4388
+ height: displayHeight ? displayHeight.value.value : height.value.value,
4389
+ width: displayWidth ? displayWidth.value.value : width.value.value,
4390
4390
  sampleAspectRatio: {
4391
4391
  numerator: 1,
4392
4392
  denominator: 1
@@ -4394,8 +4394,8 @@ var getTrack = ({
4394
4394
  originalTimescale: timescale,
4395
4395
  codedHeight: height.value.value,
4396
4396
  codedWidth: width.value.value,
4397
- displayAspectHeight: displayHeight2 ? displayHeight2.value.value : height.value.value,
4398
- displayAspectWidth: displayWidth2 ? displayWidth2.value.value : width.value.value,
4397
+ displayAspectHeight: displayHeight ? displayHeight.value.value : height.value.value,
4398
+ displayAspectWidth: displayWidth ? displayWidth.value.value : width.value.value,
4399
4399
  rotation: 0,
4400
4400
  codecData,
4401
4401
  colorSpace: mediaParserAdvancedColorToWebCodecsColor(advancedColor),
@@ -4407,10 +4407,10 @@ var getTrack = ({
4407
4407
  trackMediaTimeOffsetInTrackTimescale: 0
4408
4408
  };
4409
4409
  }
4410
- if (trackTypeToString(trackType2.value.value) === "audio") {
4410
+ if (trackTypeToString(trackType.value.value) === "audio") {
4411
4411
  const sampleRate = getSampleRate2(track);
4412
4412
  const numberOfChannels = getNumberOfChannels(track);
4413
- const codecPrivate2 = getPrivateData(track);
4413
+ const codecPrivate = getPrivateData(track);
4414
4414
  if (sampleRate === null) {
4415
4415
  throw new Error("Could not find sample rate or number of channels");
4416
4416
  }
@@ -4423,7 +4423,7 @@ var getTrack = ({
4423
4423
  numberOfChannels,
4424
4424
  sampleRate,
4425
4425
  description: getAudioDescription(track),
4426
- codecData: codecPrivate2 ? codecString === "opus" ? { type: "ogg-identification", data: codecPrivate2 } : { type: "unknown-data", data: codecPrivate2 } : null,
4426
+ codecData: codecPrivate ? codecString === "opus" ? { type: "ogg-identification", data: codecPrivate } : { type: "unknown-data", data: codecPrivate } : null,
4427
4427
  codecEnum: getMatroskaAudioCodecEnum({
4428
4428
  track
4429
4429
  }),
@@ -4548,8 +4548,8 @@ var getCategorizedTracksFromMatroska = (state) => {
4548
4548
  };
4549
4549
  var getTracksFromMoovBox = (moovBox) => {
4550
4550
  const mediaParserTracks = [];
4551
- const tracks2 = getTraks(moovBox);
4552
- for (const trakBox of tracks2) {
4551
+ const tracks = getTraks(moovBox);
4552
+ for (const trakBox of tracks) {
4553
4553
  const mvhdBox = getMvhdBox(moovBox);
4554
4554
  if (!mvhdBox) {
4555
4555
  throw new Error("Mvhd box is not found");
@@ -4584,11 +4584,11 @@ var getTracksFromIsoBaseMedia = ({
4584
4584
  return getTracksFromMoovBox(moovBox);
4585
4585
  };
4586
4586
  var defaultGetTracks = (parserState) => {
4587
- const tracks2 = parserState.callbacks.tracks.getTracks();
4588
- if (tracks2.length === 0) {
4587
+ const tracks = parserState.callbacks.tracks.getTracks();
4588
+ if (tracks.length === 0) {
4589
4589
  throw new Error("No tracks found");
4590
4590
  }
4591
- return tracks2;
4591
+ return tracks;
4592
4592
  };
4593
4593
  var getTracks = (state, mayUsePrecomputed) => {
4594
4594
  const structure = state.structure.getStructure();
@@ -4617,11 +4617,11 @@ var getTracks = (state, mayUsePrecomputed) => {
4617
4617
 
4618
4618
  // src/get-audio-codec.ts
4619
4619
  var getAudioCodec = (parserState) => {
4620
- const tracks2 = getTracks(parserState, true);
4621
- if (tracks2.length === 0) {
4620
+ const tracks = getTracks(parserState, true);
4621
+ if (tracks.length === 0) {
4622
4622
  throw new Error("No tracks yet");
4623
4623
  }
4624
- const audioTrack = tracks2.find((t) => t.type === "audio");
4624
+ const audioTrack = tracks.find((t) => t.type === "audio");
4625
4625
  if (!audioTrack) {
4626
4626
  return null;
4627
4627
  }
@@ -4900,11 +4900,11 @@ var getDimensions = (state) => {
4900
4900
  if (structure && isAudioStructure(structure)) {
4901
4901
  return null;
4902
4902
  }
4903
- const tracks2 = getTracks(state, true);
4904
- if (!tracks2.length) {
4903
+ const tracks = getTracks(state, true);
4904
+ if (!tracks.length) {
4905
4905
  return null;
4906
4906
  }
4907
- const firstVideoTrack = tracks2.find((t) => t.type === "video");
4907
+ const firstVideoTrack = tracks.find((t) => t.type === "video");
4908
4908
  if (!firstVideoTrack) {
4909
4909
  return null;
4910
4910
  }
@@ -4973,8 +4973,8 @@ var getSamplesFromTraf = (trafSegment, moofOffset, trexBoxes) => {
4973
4973
  }
4974
4974
  for (const sample of trunBox.samples) {
4975
4975
  i++;
4976
- const duration2 = sample.sampleDuration || defaultTrackSampleDuration;
4977
- if (duration2 === null) {
4976
+ const duration = sample.sampleDuration || defaultTrackSampleDuration;
4977
+ if (duration === null) {
4978
4978
  throw new Error("Expected duration");
4979
4979
  }
4980
4980
  const size = sample.sampleSize ?? defaultTrackSampleSize;
@@ -4992,7 +4992,7 @@ var getSamplesFromTraf = (trafSegment, moofOffset, trexBoxes) => {
4992
4992
  offset: offset + (moofOffset ?? 0) + (dataOffset ?? 0),
4993
4993
  decodingTimestamp: dts,
4994
4994
  timestamp: dts + (sample.sampleCompositionTimeOffset ?? 0),
4995
- duration: duration2,
4995
+ duration,
4996
4996
  isKeyframe: keyframe,
4997
4997
  size,
4998
4998
  chunk: 0,
@@ -5001,7 +5001,7 @@ var getSamplesFromTraf = (trafSegment, moofOffset, trexBoxes) => {
5001
5001
  };
5002
5002
  samples.push(samplePosition);
5003
5003
  offset += size;
5004
- time += duration2;
5004
+ time += duration;
5005
5005
  }
5006
5006
  }
5007
5007
  return samples;
@@ -5269,11 +5269,11 @@ var getPlaylist = (structure, src) => {
5269
5269
  return playlists;
5270
5270
  };
5271
5271
  var getDurationFromPlaylist = (playlist) => {
5272
- const duration2 = playlist.boxes.filter((box) => box.type === "m3u-extinf");
5273
- if (duration2.length === 0) {
5272
+ const duration = playlist.boxes.filter((box) => box.type === "m3u-extinf");
5273
+ if (duration.length === 0) {
5274
5274
  throw new Error("Expected duration in m3u playlist");
5275
5275
  }
5276
- return duration2.reduce((acc, d) => acc + d.value, 0);
5276
+ return duration.reduce((acc, d) => acc + d.value, 0);
5277
5277
  };
5278
5278
 
5279
5279
  // src/containers/m3u/get-duration-from-m3u.ts
@@ -5291,19 +5291,19 @@ var getDurationFromM3u = (state) => {
5291
5291
  var getUnroundedMpegFrameLength = ({
5292
5292
  samplesPerFrame,
5293
5293
  bitrateKbit,
5294
- samplingFrequency: samplingFrequency2,
5294
+ samplingFrequency,
5295
5295
  padding,
5296
5296
  layer
5297
5297
  }) => {
5298
5298
  if (layer === 1) {
5299
5299
  throw new Error("MPEG Layer I is not supported");
5300
5300
  }
5301
- return samplesPerFrame / 8 * bitrateKbit / samplingFrequency2 * 1000 + (padding ? layer === 1 ? 4 : 1 : 0);
5301
+ return samplesPerFrame / 8 * bitrateKbit / samplingFrequency * 1000 + (padding ? layer === 1 ? 4 : 1 : 0);
5302
5302
  };
5303
5303
  var getAverageMpegFrameLength = ({
5304
5304
  samplesPerFrame,
5305
5305
  bitrateKbit,
5306
- samplingFrequency: samplingFrequency2,
5306
+ samplingFrequency,
5307
5307
  layer
5308
5308
  }) => {
5309
5309
  const withoutPadding = getUnroundedMpegFrameLength({
@@ -5311,7 +5311,7 @@ var getAverageMpegFrameLength = ({
5311
5311
  layer,
5312
5312
  padding: false,
5313
5313
  samplesPerFrame,
5314
- samplingFrequency: samplingFrequency2
5314
+ samplingFrequency
5315
5315
  });
5316
5316
  const rounded = Math.floor(withoutPadding);
5317
5317
  const rest = withoutPadding % 1;
@@ -5320,7 +5320,7 @@ var getAverageMpegFrameLength = ({
5320
5320
  var getMpegFrameLength = ({
5321
5321
  samplesPerFrame,
5322
5322
  bitrateKbit,
5323
- samplingFrequency: samplingFrequency2,
5323
+ samplingFrequency,
5324
5324
  padding,
5325
5325
  layer
5326
5326
  }) => {
@@ -5329,7 +5329,7 @@ var getMpegFrameLength = ({
5329
5329
  layer,
5330
5330
  padding,
5331
5331
  samplesPerFrame,
5332
- samplingFrequency: samplingFrequency2
5332
+ samplingFrequency
5333
5333
  }));
5334
5334
  };
5335
5335
 
@@ -5465,15 +5465,15 @@ var getDurationFromMatroska = (segments) => {
5465
5465
  ...mainSegment.value,
5466
5466
  ...infoSegment && infoSegment.type === "Info" ? infoSegment.value : []
5467
5467
  ];
5468
- const timestampScale2 = relevantBoxes.find((s) => s.type === "TimestampScale");
5469
- if (!timestampScale2 || timestampScale2.type !== "TimestampScale") {
5468
+ const timestampScale = relevantBoxes.find((s) => s.type === "TimestampScale");
5469
+ if (!timestampScale || timestampScale.type !== "TimestampScale") {
5470
5470
  return null;
5471
5471
  }
5472
- const duration2 = relevantBoxes.find((s) => s.type === "Duration");
5473
- if (!duration2 || duration2.type !== "Duration") {
5472
+ const duration = relevantBoxes.find((s) => s.type === "Duration");
5473
+ if (!duration || duration.type !== "Duration") {
5474
5474
  return null;
5475
5475
  }
5476
- return duration2.value.value / timestampScale2.value.value * 1000;
5476
+ return duration.value.value / timestampScale.value.value * 1000;
5477
5477
  };
5478
5478
  var getDurationFromIsoBaseMedia = (parserState) => {
5479
5479
  const structure = parserState.structure.getIsoStructure();
@@ -5505,8 +5505,8 @@ var getDurationFromIsoBaseMedia = (parserState) => {
5505
5505
  if (mvhdBox.durationInSeconds > 0) {
5506
5506
  return mvhdBox.durationInSeconds;
5507
5507
  }
5508
- const tracks2 = getTracks(parserState, true);
5509
- const allSamples = tracks2.map((t) => {
5508
+ const tracks = getTracks(parserState, true);
5509
+ const allSamples = tracks.map((t) => {
5510
5510
  const { originalTimescale: ts } = t;
5511
5511
  const trakBox = getTrakBoxByTrackId(moovBox, t.trackId);
5512
5512
  if (!trakBox) {
@@ -5587,8 +5587,8 @@ var isVideoTrackHdr = (track) => {
5587
5587
  return track.advancedColor.matrix === "bt2020-ncl" && (track.advancedColor.transfer === "hlg" || track.advancedColor.transfer === "pq") && track.advancedColor.primaries === "bt2020";
5588
5588
  };
5589
5589
  var getIsHdr = (state) => {
5590
- const tracks2 = getTracks(state, true);
5591
- return tracks2.some((track) => track.type === "video" && isVideoTrackHdr(track));
5590
+ const tracks = getTracks(state, true);
5591
+ return tracks.some((track) => track.type === "video" && isVideoTrackHdr(track));
5592
5592
  };
5593
5593
  var hasHdr = (state) => {
5594
5594
  return getHasTracks(state, true);
@@ -5596,13 +5596,13 @@ var hasHdr = (state) => {
5596
5596
 
5597
5597
  // src/containers/iso-base-media/get-keyframes.ts
5598
5598
  var getKeyframesFromIsoBaseMedia = (state) => {
5599
- const tracks2 = getTracksFromIsoBaseMedia({
5599
+ const tracks = getTracksFromIsoBaseMedia({
5600
5600
  isoState: state.iso,
5601
5601
  m3uPlaylistContext: state.m3uPlaylistContext,
5602
5602
  structure: state.structure,
5603
5603
  mayUsePrecomputed: true
5604
5604
  });
5605
- const videoTracks = tracks2.filter((t) => t.type === "video");
5605
+ const videoTracks = tracks.filter((t) => t.type === "video");
5606
5606
  const structure = state.structure.getIsoStructure();
5607
5607
  const moofBoxes = getMoofBoxes(structure.boxes);
5608
5608
  const tfraBoxes = getTfraBoxes(structure.boxes);
@@ -5820,8 +5820,8 @@ var getMetadataFromMatroska = (structure) => {
5820
5820
  if (segment.type !== "Segment") {
5821
5821
  continue;
5822
5822
  }
5823
- const tags2 = segment.value.filter((s) => s.type === "Tags");
5824
- for (const tag of tags2) {
5823
+ const tags = segment.value.filter((s) => s.type === "Tags");
5824
+ for (const tag of tags) {
5825
5825
  for (const child of tag.value) {
5826
5826
  if (child.type !== "Tag") {
5827
5827
  continue;
@@ -5879,8 +5879,8 @@ var getMetadata = (state) => {
5879
5879
  return [];
5880
5880
  }
5881
5881
  if (structure.type === "mp3") {
5882
- const tags2 = getMetadataFromMp3(structure);
5883
- return tags2 ?? [];
5882
+ const tags = getMetadataFromMp3(structure);
5883
+ return tags ?? [];
5884
5884
  }
5885
5885
  if (structure.type === "wav") {
5886
5886
  return getMetadataFromWav(structure) ?? [];
@@ -6246,13 +6246,13 @@ var getSeekingByteFromFragmentedMp4 = async ({
6246
6246
  logLevel,
6247
6247
  currentPosition,
6248
6248
  isoState,
6249
- tracks: tracks2,
6249
+ tracks,
6250
6250
  isLastChunkInPlaylist,
6251
6251
  structure,
6252
6252
  mp4HeaderSegment
6253
6253
  }) => {
6254
- const firstVideoTrack = tracks2.find((t) => t.type === "video");
6255
- const firstTrack = firstVideoTrack ?? tracks2.find((t) => t.type === "audio");
6254
+ const firstVideoTrack = tracks.find((t) => t.type === "video");
6255
+ const firstTrack = firstVideoTrack ?? tracks.find((t) => t.type === "audio");
6256
6256
  if (!firstTrack) {
6257
6257
  throw new Error("no video and no audio tracks");
6258
6258
  }
@@ -6354,7 +6354,7 @@ var getSeekingByteFromIsoBaseMedia = ({
6354
6354
  m3uPlaylistContext,
6355
6355
  structure
6356
6356
  }) => {
6357
- const tracks2 = getTracksFromIsoBaseMedia({
6357
+ const tracks = getTracksFromIsoBaseMedia({
6358
6358
  isoState,
6359
6359
  m3uPlaylistContext,
6360
6360
  structure,
@@ -6379,13 +6379,13 @@ var getSeekingByteFromIsoBaseMedia = ({
6379
6379
  logLevel,
6380
6380
  currentPosition,
6381
6381
  isoState,
6382
- tracks: tracks2,
6382
+ tracks,
6383
6383
  isLastChunkInPlaylist: m3uPlaylistContext?.isLastChunkInPlaylist ?? false,
6384
6384
  structure,
6385
6385
  mp4HeaderSegment: m3uPlaylistContext?.mp4HeaderSegment ?? null
6386
6386
  });
6387
6387
  }
6388
- const trackWithSamplePositions = findTrackToSeek(tracks2, structure);
6388
+ const trackWithSamplePositions = findTrackToSeek(tracks, structure);
6389
6389
  if (!trackWithSamplePositions) {
6390
6390
  return Promise.resolve({
6391
6391
  type: "valid-but-must-wait"
@@ -6626,7 +6626,7 @@ var getSeekPointFromXing = ({
6626
6626
  layer: mp3Info.layer,
6627
6627
  mpegVersion: mp3Info.mpegVersion
6628
6628
  });
6629
- const duration2 = getDurationFromMp3Xing({
6629
+ const duration = getDurationFromMp3Xing({
6630
6630
  xingData,
6631
6631
  samplesPerFrame
6632
6632
  });
@@ -6638,7 +6638,7 @@ var getSeekPointFromXing = ({
6638
6638
  }
6639
6639
  return getSeekPointInBytes({
6640
6640
  fileSize: xingData.fileSize,
6641
- percentBetween0And100: timeToTarget / duration2 * 100,
6641
+ percentBetween0And100: timeToTarget / duration * 100,
6642
6642
  tableOfContents: xingData.tableOfContents
6643
6643
  });
6644
6644
  };
@@ -6801,16 +6801,16 @@ var registerVideoTrack = async ({
6801
6801
  logLevel,
6802
6802
  onVideoTrack,
6803
6803
  registerVideoSampleCallback,
6804
- tracks: tracks2
6804
+ tracks
6805
6805
  }) => {
6806
- if (tracks2.getTracks().find((t) => t.trackId === track.trackId)) {
6806
+ if (tracks.getTracks().find((t) => t.trackId === track.trackId)) {
6807
6807
  Log.trace(logLevel, `Track ${track.trackId} already registered, skipping`);
6808
6808
  return null;
6809
6809
  }
6810
6810
  if (track.type !== "video") {
6811
6811
  throw new Error("Expected video track");
6812
6812
  }
6813
- tracks2.addTrack(track);
6813
+ tracks.addTrack(track);
6814
6814
  if (!onVideoTrack) {
6815
6815
  return null;
6816
6816
  }
@@ -6824,19 +6824,19 @@ var registerVideoTrack = async ({
6824
6824
  var registerAudioTrack = async ({
6825
6825
  track,
6826
6826
  container,
6827
- tracks: tracks2,
6827
+ tracks,
6828
6828
  logLevel,
6829
6829
  onAudioTrack,
6830
6830
  registerAudioSampleCallback
6831
6831
  }) => {
6832
- if (tracks2.getTracks().find((t) => t.trackId === track.trackId)) {
6832
+ if (tracks.getTracks().find((t) => t.trackId === track.trackId)) {
6833
6833
  Log.trace(logLevel, `Track ${track.trackId} already registered, skipping`);
6834
6834
  return null;
6835
6835
  }
6836
6836
  if (track.type !== "audio") {
6837
6837
  throw new Error("Expected audio track");
6838
6838
  }
6839
- tracks2.addTrack(track);
6839
+ tracks.addTrack(track);
6840
6840
  if (!onAudioTrack) {
6841
6841
  return null;
6842
6842
  }
@@ -6886,12 +6886,12 @@ var getSampleAspectRatioFromSps = (sps) => {
6886
6886
  };
6887
6887
  };
6888
6888
  var getVideoColorFromSps = (sps) => {
6889
- const matrixCoefficients2 = sps.vui_parameters?.matrix_coefficients;
6890
- const transferCharacteristics2 = sps.vui_parameters?.transfer_characteristics;
6889
+ const matrixCoefficients = sps.vui_parameters?.matrix_coefficients;
6890
+ const transferCharacteristics = sps.vui_parameters?.transfer_characteristics;
6891
6891
  const colorPrimaries = sps.vui_parameters?.colour_primaries;
6892
6892
  return {
6893
- matrix: matrixCoefficients2 ? getMatrixCoefficientsFromIndex(matrixCoefficients2) : null,
6894
- transfer: transferCharacteristics2 ? getTransferCharacteristicsFromIndex(transferCharacteristics2) : null,
6893
+ matrix: matrixCoefficients ? getMatrixCoefficientsFromIndex(matrixCoefficients) : null,
6894
+ transfer: transferCharacteristics ? getTransferCharacteristicsFromIndex(transferCharacteristics) : null,
6895
6895
  primaries: colorPrimaries ? getPrimariesFromIndex(colorPrimaries) : null,
6896
6896
  fullRange: sps.vui_parameters?.video_full_range_flag ?? null
6897
6897
  };
@@ -7247,7 +7247,7 @@ var handleAvcPacket = async ({
7247
7247
  trackId: programId,
7248
7248
  newOffset: startOffset
7249
7249
  });
7250
- const codecPrivate2 = createSpsPpsData(spsAndPps);
7250
+ const codecPrivate = createSpsPpsData(spsAndPps);
7251
7251
  const advancedColor = getVideoColorFromSps(spsAndPps.sps.spsData);
7252
7252
  const track = {
7253
7253
  m3uStreamFormat: null,
@@ -7256,7 +7256,7 @@ var handleAvcPacket = async ({
7256
7256
  type: "video",
7257
7257
  originalTimescale: MPEG_TIMESCALE,
7258
7258
  codec: getCodecStringFromSpsAndPps(spsAndPps.sps),
7259
- codecData: { type: "avc-sps-pps", data: codecPrivate2 },
7259
+ codecData: { type: "avc-sps-pps", data: codecPrivate },
7260
7260
  fps: null,
7261
7261
  codedWidth: dimensions.width,
7262
7262
  codedHeight: dimensions.height,
@@ -7629,7 +7629,7 @@ var getSeekingHintsFromMp4 = ({
7629
7629
  structureState,
7630
7630
  isoState,
7631
7631
  mp4HeaderSegment,
7632
- mediaSectionState: mediaSectionState2
7632
+ mediaSectionState
7633
7633
  }) => {
7634
7634
  const structure = structureState.getIsoStructure();
7635
7635
  const moovAtom = getMoovBoxFromState({
@@ -7654,7 +7654,7 @@ var getSeekingHintsFromMp4 = ({
7654
7654
  moovBox: moovAtom,
7655
7655
  moofBoxes,
7656
7656
  tfraBoxes,
7657
- mediaSections: mediaSectionState2.getMediaSections(),
7657
+ mediaSections: mediaSectionState.getMediaSections(),
7658
7658
  mfraAlreadyLoaded: isoState.mfra.getIfAlreadyLoaded()
7659
7659
  };
7660
7660
  };
@@ -7671,7 +7671,7 @@ var getSeekingHintsForM3u = () => {
7671
7671
  var getSeekingHintsForMp3 = ({
7672
7672
  mp3State,
7673
7673
  samplesObserved,
7674
- mediaSectionState: mediaSectionState2,
7674
+ mediaSectionState,
7675
7675
  contentLength
7676
7676
  }) => {
7677
7677
  return {
@@ -7680,7 +7680,7 @@ var getSeekingHintsForMp3 = ({
7680
7680
  lastSampleObserved: samplesObserved.getLastSampleObserved(),
7681
7681
  mp3BitrateInfo: mp3State.getMp3BitrateInfo(),
7682
7682
  mp3Info: mp3State.getMp3Info(),
7683
- mediaSection: mediaSectionState2.getMediaSections()[0] ?? null,
7683
+ mediaSection: mediaSectionState.getMediaSections()[0] ?? null,
7684
7684
  contentLength
7685
7685
  };
7686
7686
  };
@@ -7700,7 +7700,7 @@ var riffHasIndex = (structure) => {
7700
7700
  var getSeekingHintsForRiff = ({
7701
7701
  structureState,
7702
7702
  riffState,
7703
- mediaSectionState: mediaSectionState2
7703
+ mediaSectionState
7704
7704
  }) => {
7705
7705
  const structure = structureState.getRiffStructure();
7706
7706
  const strl = getStrlBoxes(structure);
@@ -7721,7 +7721,7 @@ var getSeekingHintsForRiff = ({
7721
7721
  hasIndex: riffHasIndex(structure),
7722
7722
  idx1Entries: riffState.lazyIdx1.getIfAlreadyLoaded(),
7723
7723
  samplesPerSecond,
7724
- moviOffset: mediaSectionState2.getMediaSections()[0]?.start ?? null,
7724
+ moviOffset: mediaSectionState.getMediaSections()[0]?.start ?? null,
7725
7725
  observedKeyframes: riffState.sampleCounter.riffKeys.getKeyframes()
7726
7726
  };
7727
7727
  };
@@ -7760,13 +7760,13 @@ var setSeekingHintsForTransportStream = ({
7760
7760
  // src/containers/wav/seeking-hints.ts
7761
7761
  var getSeekingHintsFromWav = ({
7762
7762
  structure,
7763
- mediaSectionState: mediaSectionState2
7763
+ mediaSectionState
7764
7764
  }) => {
7765
7765
  const fmtBox = structure.boxes.find((box) => box.type === "wav-fmt");
7766
7766
  if (!fmtBox) {
7767
7767
  return null;
7768
7768
  }
7769
- const mediaSection = mediaSectionState2.getMediaSections();
7769
+ const mediaSection = mediaSectionState.getMediaSections();
7770
7770
  if (mediaSection.length !== 1) {
7771
7771
  return null;
7772
7772
  }
@@ -7786,8 +7786,8 @@ var setSeekingHintsForWav = ({
7786
7786
 
7787
7787
  // src/containers/webm/seek/seeking-hints.ts
7788
7788
  var getSeekingHintsFromMatroska = (tracksState, keyframesState, webmState) => {
7789
- const tracks2 = tracksState.getTracks();
7790
- const firstVideoTrack = tracks2.find((track) => track.type === "video");
7789
+ const tracks = tracksState.getTracks();
7790
+ const firstVideoTrack = tracks.find((track) => track.type === "video");
7791
7791
  const keyframes = keyframesState.getKeyframes();
7792
7792
  const loadedCues = webmState.cues.getIfAlreadyLoaded();
7793
7793
  return {
@@ -7814,7 +7814,7 @@ var setSeekingHintsForWebm = ({
7814
7814
  var getSeekingHints = ({
7815
7815
  structureState,
7816
7816
  m3uPlaylistContext,
7817
- mediaSectionState: mediaSectionState2,
7817
+ mediaSectionState,
7818
7818
  isoState,
7819
7819
  transportStream,
7820
7820
  tracksState,
@@ -7836,13 +7836,13 @@ var getSeekingHints = ({
7836
7836
  structureState,
7837
7837
  isoState,
7838
7838
  mp4HeaderSegment: m3uPlaylistContext?.mp4HeaderSegment ?? null,
7839
- mediaSectionState: mediaSectionState2
7839
+ mediaSectionState
7840
7840
  });
7841
7841
  }
7842
7842
  if (structure.type === "wav") {
7843
7843
  return getSeekingHintsFromWav({
7844
7844
  structure,
7845
- mediaSectionState: mediaSectionState2
7845
+ mediaSectionState
7846
7846
  });
7847
7847
  }
7848
7848
  if (structure.type === "matroska") {
@@ -7861,14 +7861,14 @@ var getSeekingHints = ({
7861
7861
  return getSeekingHintsForRiff({
7862
7862
  structureState,
7863
7863
  riffState,
7864
- mediaSectionState: mediaSectionState2
7864
+ mediaSectionState
7865
7865
  });
7866
7866
  }
7867
7867
  if (structure.type === "mp3") {
7868
7868
  return getSeekingHintsForMp3({
7869
7869
  mp3State,
7870
7870
  samplesObserved,
7871
- mediaSectionState: mediaSectionState2,
7871
+ mediaSectionState,
7872
7872
  contentLength
7873
7873
  });
7874
7874
  }
@@ -8113,8 +8113,8 @@ var performSeek = async ({
8113
8113
 
8114
8114
  // src/work-on-seek-request.ts
8115
8115
  var turnSeekIntoByte = async ({
8116
- seek: seek2,
8117
- mediaSectionState: mediaSectionState2,
8116
+ seek,
8117
+ mediaSectionState,
8118
8118
  logLevel,
8119
8119
  iterator,
8120
8120
  structureState,
@@ -8133,21 +8133,21 @@ var turnSeekIntoByte = async ({
8133
8133
  m3uState,
8134
8134
  avcState
8135
8135
  }) => {
8136
- const mediaSections = mediaSectionState2.getMediaSections();
8136
+ const mediaSections = mediaSectionState.getMediaSections();
8137
8137
  if (mediaSections.length === 0) {
8138
8138
  Log.trace(logLevel, "No media sections defined, cannot seek yet");
8139
8139
  return {
8140
8140
  type: "valid-but-must-wait"
8141
8141
  };
8142
8142
  }
8143
- if (seek2 < 0) {
8144
- throw new Error(`Cannot seek to a negative time: ${JSON.stringify(seek2)}`);
8143
+ if (seek < 0) {
8144
+ throw new Error(`Cannot seek to a negative time: ${JSON.stringify(seek)}`);
8145
8145
  }
8146
8146
  const seekingHints = getSeekingHints({
8147
8147
  riffState,
8148
8148
  samplesObserved,
8149
8149
  structureState,
8150
- mediaSectionState: mediaSectionState2,
8150
+ mediaSectionState,
8151
8151
  isoState,
8152
8152
  transportStream,
8153
8153
  tracksState,
@@ -8167,13 +8167,13 @@ var turnSeekIntoByte = async ({
8167
8167
  }
8168
8168
  const seekingByte = await getSeekingByte({
8169
8169
  info: seekingHints,
8170
- time: seek2,
8170
+ time: seek,
8171
8171
  logLevel,
8172
8172
  currentPosition: iterator.counter.getOffset(),
8173
8173
  isoState,
8174
8174
  transportStream,
8175
8175
  webmState,
8176
- mediaSection: mediaSectionState2,
8176
+ mediaSection: mediaSectionState,
8177
8177
  m3uPlaylistContext,
8178
8178
  structure: structureState,
8179
8179
  riffState,
@@ -8243,13 +8243,13 @@ var workOnSeekRequest = async (options) => {
8243
8243
  m3uState,
8244
8244
  avcState
8245
8245
  } = options;
8246
- const seek2 = controller._internals.seekSignal.getSeek();
8247
- if (seek2 === null) {
8246
+ const seek = controller._internals.seekSignal.getSeek();
8247
+ if (seek === null) {
8248
8248
  return;
8249
8249
  }
8250
- Log.trace(logLevel, `Has seek request for ${src}: ${JSON.stringify(seek2)}`);
8250
+ Log.trace(logLevel, `Has seek request for ${src}: ${JSON.stringify(seek)}`);
8251
8251
  const resolution = await turnSeekIntoByte({
8252
- seek: seek2,
8252
+ seek,
8253
8253
  mediaSectionState: mediaSection,
8254
8254
  logLevel,
8255
8255
  iterator,
@@ -8310,7 +8310,7 @@ var workOnSeekRequest = async (options) => {
8310
8310
  prefetchCache,
8311
8311
  isoState
8312
8312
  });
8313
- const { hasChanged } = controller._internals.seekSignal.clearSeekIfStillSame(seek2);
8313
+ const { hasChanged } = controller._internals.seekSignal.clearSeekIfStillSame(seek);
8314
8314
  if (hasChanged) {
8315
8315
  Log.trace(logLevel, `Seek request has changed while seeking, seeking again`);
8316
8316
  await workOnSeekRequest(options);
@@ -8318,7 +8318,7 @@ var workOnSeekRequest = async (options) => {
8318
8318
  return;
8319
8319
  }
8320
8320
  if (resolution.type === "invalid") {
8321
- throw new Error(`The seek request ${JSON.stringify(seek2)} cannot be processed`);
8321
+ throw new Error(`The seek request ${JSON.stringify(seek)} cannot be processed`);
8322
8322
  }
8323
8323
  if (resolution.type === "valid-but-must-wait") {
8324
8324
  Log.trace(logLevel, "Seek request is valid but cannot be processed yet");
@@ -8474,10 +8474,10 @@ var emitAvailableInfo = async ({
8474
8474
  }
8475
8475
  if (key === "tracks") {
8476
8476
  if (!emittedFields.tracks && hasInfo.tracks) {
8477
- const tracks2 = getTracks(state, true);
8478
- await callbackFunctions.onTracks?.(tracks2);
8477
+ const tracks = getTracks(state, true);
8478
+ await callbackFunctions.onTracks?.(tracks);
8479
8479
  if (fieldsInReturnValue.tracks) {
8480
- returnValue.tracks = tracks2;
8480
+ returnValue.tracks = tracks;
8481
8481
  }
8482
8482
  emittedFields.tracks = true;
8483
8483
  }
@@ -8895,7 +8895,7 @@ var parseAac = async (state) => {
8895
8895
  const sampleRate = getSampleRateFromSampleFrequencyIndex(samplingFrequencyIndex);
8896
8896
  iterator.getBits(1);
8897
8897
  const channelConfiguration = iterator.getBits(3);
8898
- const codecPrivate2 = createAacCodecPrivate({
8898
+ const codecPrivate = createAacCodecPrivate({
8899
8899
  audioObjectType,
8900
8900
  sampleRate,
8901
8901
  channelConfiguration,
@@ -8924,8 +8924,8 @@ var parseAac = async (state) => {
8924
8924
  track: {
8925
8925
  codec: mapAudioObjectTypeToCodecString(audioObjectType),
8926
8926
  codecEnum: "aac",
8927
- codecData: { type: "aac-config", data: codecPrivate2 },
8928
- description: codecPrivate2,
8927
+ codecData: { type: "aac-config", data: codecPrivate },
8928
+ description: codecPrivate,
8929
8929
  numberOfChannels: channelConfiguration,
8930
8930
  sampleRate,
8931
8931
  originalTimescale: WEBCODECS_TIMESCALE,
@@ -8942,17 +8942,17 @@ var parseAac = async (state) => {
8942
8942
  });
8943
8943
  state.callbacks.tracks.setIsDone(state.logLevel);
8944
8944
  }
8945
- const duration2 = 1024 / sampleRate;
8945
+ const duration = 1024 / sampleRate;
8946
8946
  const { index } = state.aac.addSample({ offset: startOffset, size: frameLength });
8947
8947
  const timestamp = 1024 / sampleRate * index;
8948
8948
  state.aac.audioSamples.addSample({
8949
8949
  timeInSeconds: timestamp,
8950
8950
  offset: startOffset,
8951
- durationInSeconds: duration2
8951
+ durationInSeconds: duration
8952
8952
  });
8953
8953
  const audioSample = convertAudioOrVideoSampleToWebCodecsTimestamps({
8954
8954
  sample: {
8955
- duration: duration2,
8955
+ duration,
8956
8956
  type: "key",
8957
8957
  data,
8958
8958
  offset: startOffset,
@@ -9158,7 +9158,7 @@ var emitSample = async ({
9158
9158
  throw new Error("Invalid CRC");
9159
9159
  }
9160
9160
  const { blockSize, num, sampleRate } = parsed;
9161
- const duration2 = blockSize / sampleRate;
9161
+ const duration = blockSize / sampleRate;
9162
9162
  const structure = state.structure.getFlacStructure();
9163
9163
  const streamInfo = structure.boxes.find((box) => box.type === "flac-streaminfo");
9164
9164
  if (!streamInfo) {
@@ -9171,12 +9171,12 @@ var emitSample = async ({
9171
9171
  state.flac.audioSamples.addSample({
9172
9172
  timeInSeconds: timestamp,
9173
9173
  offset,
9174
- durationInSeconds: duration2
9174
+ durationInSeconds: duration
9175
9175
  });
9176
9176
  const audioSample = convertAudioOrVideoSampleToWebCodecsTimestamps({
9177
9177
  sample: {
9178
9178
  data,
9179
- duration: duration2,
9179
+ duration,
9180
9180
  decodingTimestamp: timestamp,
9181
9181
  timestamp,
9182
9182
  type: "key",
@@ -9312,7 +9312,7 @@ var parseStreamInfo = async ({
9312
9312
  const maximumFrameSize = iterator.getUint24();
9313
9313
  iterator.startReadingBits();
9314
9314
  const sampleRate = iterator.getBits(20);
9315
- const channels2 = iterator.getBits(3) + 1;
9315
+ const channels = iterator.getBits(3) + 1;
9316
9316
  const bitsPerSample = iterator.getBits(5);
9317
9317
  const totalSamples = iterator.getBits(36);
9318
9318
  iterator.getBits(128);
@@ -9324,7 +9324,7 @@ var parseStreamInfo = async ({
9324
9324
  const flacStreamInfo = {
9325
9325
  type: "flac-streaminfo",
9326
9326
  bitsPerSample,
9327
- channels: channels2,
9327
+ channels,
9328
9328
  maximumBlockSize,
9329
9329
  maximumFrameSize,
9330
9330
  minimumBlockSize,
@@ -9341,7 +9341,7 @@ var parseStreamInfo = async ({
9341
9341
  description: asUint8Array,
9342
9342
  codecData: { type: "flac-description", data: asUint8Array },
9343
9343
  codecEnum: "flac",
9344
- numberOfChannels: channels2,
9344
+ numberOfChannels: channels,
9345
9345
  sampleRate,
9346
9346
  originalTimescale: WEBCODECS_TIMESCALE,
9347
9347
  trackId: 0,
@@ -9405,8 +9405,8 @@ var parseFlac = ({
9405
9405
  iterator,
9406
9406
  state
9407
9407
  }) => {
9408
- const mediaSectionState2 = state.mediaSection.isCurrentByteInMediaSection(iterator);
9409
- if (mediaSectionState2 === "in-section") {
9408
+ const mediaSectionState = state.mediaSection.isCurrentByteInMediaSection(iterator);
9409
+ if (mediaSectionState === "in-section") {
9410
9410
  if (maySkipVideoData({ state })) {
9411
9411
  return Promise.resolve(makeSkip(state.contentLength));
9412
9412
  }
@@ -9429,7 +9429,7 @@ var calculateSamplePositions = ({
9429
9429
  mediaSectionStart,
9430
9430
  trackIds
9431
9431
  }) => {
9432
- const tracks2 = getTracks(state, true);
9432
+ const tracks = getTracks(state, true);
9433
9433
  const moofBoxes = getMoofBoxes(state.structure.getIsoStructure().boxes);
9434
9434
  const tfraBoxes = deduplicateTfraBoxesByOffset([
9435
9435
  ...state.iso.tfra.getTfraBoxes(),
@@ -9450,7 +9450,7 @@ var calculateSamplePositions = ({
9450
9450
  throw new Error("No moov box found");
9451
9451
  }
9452
9452
  const trackIdAndSamplePositions = [];
9453
- for (const track of tracks2) {
9453
+ for (const track of tracks) {
9454
9454
  const trakBox = getTrakBoxByTrackId(moov, track.trackId);
9455
9455
  if (!trackIds.includes(track.trackId)) {
9456
9456
  Log.verbose(state.logLevel, "Skipping calculating sample positions for track", track.trackId);
@@ -9619,7 +9619,7 @@ var makeCanSkipTracksState = ({
9619
9619
 
9620
9620
  // src/state/has-tracks-section.ts
9621
9621
  var makeTracksSectionState = (canSkipTracksState, src) => {
9622
- const tracks2 = [];
9622
+ const tracks = [];
9623
9623
  let doneWithTracks = false;
9624
9624
  return {
9625
9625
  hasAllTracks: () => doneWithTracks,
@@ -9632,10 +9632,10 @@ var makeTracksSectionState = (canSkipTracksState, src) => {
9632
9632
  doneWithTracks = true;
9633
9633
  },
9634
9634
  addTrack: (track) => {
9635
- tracks2.push(track);
9635
+ tracks.push(track);
9636
9636
  },
9637
9637
  getTracks: () => {
9638
- return tracks2;
9638
+ return tracks;
9639
9639
  },
9640
9640
  ensureHasTracksAtEnd: (fields) => {
9641
9641
  if (canSkipTracksState.canSkipTracks()) {
@@ -9960,8 +9960,8 @@ var parseMdhd = ({
9960
9960
  const creationTime = version === 1 ? Number(data.getUint64()) : data.getUint32();
9961
9961
  const modificationTime = version === 1 ? Number(data.getUint64()) : data.getUint32();
9962
9962
  const timescale = data.getUint32();
9963
- const duration2 = version === 1 ? data.getUint64() : data.getUint32();
9964
- const language2 = data.getUint16();
9963
+ const duration = version === 1 ? data.getUint64() : data.getUint32();
9964
+ const language = data.getUint16();
9965
9965
  const quality = data.getUint16();
9966
9966
  const remaining = size - (data.counter.getOffset() - fileOffset);
9967
9967
  if (remaining !== 0) {
@@ -9969,10 +9969,10 @@ var parseMdhd = ({
9969
9969
  }
9970
9970
  return {
9971
9971
  type: "mdhd-box",
9972
- duration: Number(duration2),
9972
+ duration: Number(duration),
9973
9973
  timescale,
9974
9974
  version,
9975
- language: language2,
9975
+ language,
9976
9976
  quality,
9977
9977
  creationTime,
9978
9978
  modificationTime
@@ -10479,7 +10479,7 @@ var parseColorParameterBox = ({
10479
10479
  }) => {
10480
10480
  const byteString = iterator.getByteString(4, false);
10481
10481
  if (byteString === "nclx") {
10482
- const primaries2 = iterator.getUint16();
10482
+ const primaries = iterator.getUint16();
10483
10483
  const transfer = iterator.getUint16();
10484
10484
  const matrixIndex = iterator.getUint16();
10485
10485
  iterator.startReadingBits();
@@ -10490,12 +10490,12 @@ var parseColorParameterBox = ({
10490
10490
  colorType: "transfer-characteristics",
10491
10491
  fullRangeFlag,
10492
10492
  matrixIndex,
10493
- primaries: primaries2,
10493
+ primaries,
10494
10494
  transfer
10495
10495
  };
10496
10496
  }
10497
10497
  if (byteString === "nclc") {
10498
- const primaries2 = iterator.getUint16();
10498
+ const primaries = iterator.getUint16();
10499
10499
  const transfer = iterator.getUint16();
10500
10500
  const matrixIndex = iterator.getUint16();
10501
10501
  return {
@@ -10503,7 +10503,7 @@ var parseColorParameterBox = ({
10503
10503
  colorType: "transfer-characteristics",
10504
10504
  fullRangeFlag: false,
10505
10505
  matrixIndex,
10506
- primaries: primaries2,
10506
+ primaries,
10507
10507
  transfer
10508
10508
  };
10509
10509
  }
@@ -11150,9 +11150,9 @@ var parseStts = ({
11150
11150
  var getvp09ConfigurationString = ({
11151
11151
  profile,
11152
11152
  level,
11153
- bitDepth: bitDepth2
11153
+ bitDepth
11154
11154
  }) => {
11155
- return `${String(profile).padStart(2, "0")}.${String(level).padStart(2, "0")}.${String(bitDepth2).padStart(2, "0")}`;
11155
+ return `${String(profile).padStart(2, "0")}.${String(level).padStart(2, "0")}.${String(bitDepth).padStart(2, "0")}`;
11156
11156
  };
11157
11157
  var parseVpcc = ({
11158
11158
  data,
@@ -11167,7 +11167,7 @@ var parseVpcc = ({
11167
11167
  const profile = data.getUint8();
11168
11168
  const level = data.getUint8();
11169
11169
  data.startReadingBits();
11170
- const bitDepth2 = data.getBits(4);
11170
+ const bitDepth = data.getBits(4);
11171
11171
  const chromaSubsampling = data.getBits(3);
11172
11172
  const videoFullRangeFlag = data.getBits(1);
11173
11173
  const videoColorPrimaries = data.getBits(8);
@@ -11181,7 +11181,7 @@ var parseVpcc = ({
11181
11181
  type: "vpcc-box",
11182
11182
  profile,
11183
11183
  level,
11184
- bitDepth: bitDepth2,
11184
+ bitDepth,
11185
11185
  chromaSubsampling,
11186
11186
  videoFullRangeFlag,
11187
11187
  videoColorPrimaries,
@@ -11189,7 +11189,7 @@ var parseVpcc = ({
11189
11189
  videoMatrixCoefficients,
11190
11190
  codecInitializationDataSize,
11191
11191
  codecInitializationData,
11192
- codecString: getvp09ConfigurationString({ profile, level, bitDepth: bitDepth2 })
11192
+ codecString: getvp09ConfigurationString({ profile, level, bitDepth })
11193
11193
  };
11194
11194
  };
11195
11195
 
@@ -11285,7 +11285,7 @@ var parseTkhd = ({
11285
11285
  const modificationTime = version === 1 ? iterator.getUint64() : iterator.getUint32();
11286
11286
  const trackId = iterator.getUint32();
11287
11287
  iterator.discard(4);
11288
- const duration2 = version === 1 ? iterator.getUint64() : iterator.getUint32();
11288
+ const duration = version === 1 ? iterator.getUint64() : iterator.getUint32();
11289
11289
  iterator.discard(4);
11290
11290
  iterator.discard(4);
11291
11291
  const layer = iterator.getUint16();
@@ -11319,7 +11319,7 @@ var parseTkhd = ({
11319
11319
  creationTime: toUnixTimestamp(Number(creationTime)),
11320
11320
  modificationTime: toUnixTimestamp(Number(modificationTime)),
11321
11321
  trackId,
11322
- duration: Number(duration2),
11322
+ duration: Number(duration),
11323
11323
  layer,
11324
11324
  alternateGroup,
11325
11325
  volume,
@@ -11433,8 +11433,8 @@ var processBox = async ({
11433
11433
  if (!onlyIfMdatAtomExpected) {
11434
11434
  return { type: "nothing" };
11435
11435
  }
11436
- const { mediaSectionState: mediaSectionState2 } = onlyIfMdatAtomExpected;
11437
- mediaSectionState2.addMediaSection({
11436
+ const { mediaSectionState } = onlyIfMdatAtomExpected;
11437
+ mediaSectionState.addMediaSection({
11438
11438
  size: boxSize - headerLength,
11439
11439
  start: iterator.counter.getOffset()
11440
11440
  });
@@ -11626,8 +11626,8 @@ var processBox = async ({
11626
11626
  if (!onlyIfMoovAtomExpected) {
11627
11627
  throw new Error("State is required");
11628
11628
  }
11629
- const { tracks: tracks2, isoState } = onlyIfMoovAtomExpected;
11630
- if (tracks2.hasAllTracks()) {
11629
+ const { tracks, isoState } = onlyIfMoovAtomExpected;
11630
+ if (tracks.hasAllTracks()) {
11631
11631
  iterator.discard(boxSize - 8);
11632
11632
  return { type: "nothing" };
11633
11633
  }
@@ -11644,14 +11644,14 @@ var processBox = async ({
11644
11644
  logLevel,
11645
11645
  contentLength
11646
11646
  });
11647
- tracks2.setIsDone(logLevel);
11647
+ tracks.setIsDone(logLevel);
11648
11648
  return { type: "box", box };
11649
11649
  }
11650
11650
  if (boxType === "trak") {
11651
11651
  if (!onlyIfMoovAtomExpected) {
11652
11652
  throw new Error("State is required");
11653
11653
  }
11654
- const { tracks: tracks2, onAudioTrack, onVideoTrack } = onlyIfMoovAtomExpected;
11654
+ const { tracks, onAudioTrack, onVideoTrack } = onlyIfMoovAtomExpected;
11655
11655
  const trakBox = await parseTrak({
11656
11656
  size: boxSize,
11657
11657
  offsetAtStart: fileOffset,
@@ -11672,7 +11672,7 @@ var processBox = async ({
11672
11672
  logLevel,
11673
11673
  onVideoTrack,
11674
11674
  registerVideoSampleCallback: onlyIfMoovAtomExpected.registerVideoSampleCallback,
11675
- tracks: tracks2
11675
+ tracks
11676
11676
  });
11677
11677
  }
11678
11678
  if (transformedTrack && transformedTrack.type === "audio") {
@@ -11680,7 +11680,7 @@ var processBox = async ({
11680
11680
  track: transformedTrack,
11681
11681
  container: "mp4",
11682
11682
  registerAudioSampleCallback: onlyIfMoovAtomExpected.registerAudioSampleCallback,
11683
- tracks: tracks2,
11683
+ tracks,
11684
11684
  logLevel,
11685
11685
  onAudioTrack
11686
11686
  });
@@ -11982,12 +11982,12 @@ var parseMdatSection = async (state) => {
11982
11982
  state.structure.getIsoStructure().boxes.push(moov);
11983
11983
  return parseMdatSection(state);
11984
11984
  }
11985
- const tracks2 = state.callbacks.tracks.getTracks();
11985
+ const tracks = state.callbacks.tracks.getTracks();
11986
11986
  if (!state.iso.flatSamples.getSamples(mediaSection.start)) {
11987
11987
  const samplePosition = calculateSamplePositions({
11988
11988
  state,
11989
11989
  mediaSectionStart: mediaSection.start,
11990
- trackIds: tracks2.map((t) => t.trackId)
11990
+ trackIds: tracks.map((t) => t.trackId)
11991
11991
  });
11992
11992
  state.iso.flatSamples.setSamples(mediaSection.start, samplePosition);
11993
11993
  }
@@ -12014,13 +12014,13 @@ var parseMdatSection = async (state) => {
12014
12014
  const {
12015
12015
  timestamp: rawCts,
12016
12016
  decodingTimestamp: rawDts,
12017
- duration: duration2,
12017
+ duration,
12018
12018
  isKeyframe,
12019
12019
  offset,
12020
12020
  bigEndian,
12021
12021
  chunkSize
12022
12022
  } = nextSample.samplePosition;
12023
- const track = tracks2.find((t) => t.trackId === nextSample.trackId);
12023
+ const track = tracks.find((t) => t.trackId === nextSample.trackId);
12024
12024
  const {
12025
12025
  originalTimescale,
12026
12026
  startInSeconds,
@@ -12039,7 +12039,7 @@ var parseMdatSection = async (state) => {
12039
12039
  sample: {
12040
12040
  data: bytes,
12041
12041
  timestamp: cts,
12042
- duration: duration2,
12042
+ duration,
12043
12043
  decodingTimestamp: dts,
12044
12044
  type: isKeyframe ? "key" : "delta",
12045
12045
  offset
@@ -12062,7 +12062,7 @@ var parseMdatSection = async (state) => {
12062
12062
  sample: {
12063
12063
  data: bytes,
12064
12064
  timestamp: cts,
12065
- duration: duration2,
12065
+ duration,
12066
12066
  decodingTimestamp: dts,
12067
12067
  type: isKeyframe && !isRecoveryPoint ? "key" : "delta",
12068
12068
  offset
@@ -12080,8 +12080,8 @@ var parseMdatSection = async (state) => {
12080
12080
 
12081
12081
  // src/containers/iso-base-media/parse-boxes.ts
12082
12082
  var parseIsoBaseMedia = async (state) => {
12083
- const mediaSectionState2 = state.mediaSection.isCurrentByteInMediaSection(state.iterator);
12084
- if (mediaSectionState2 === "in-section") {
12083
+ const mediaSectionState = state.mediaSection.isCurrentByteInMediaSection(state.iterator);
12084
+ if (mediaSectionState === "in-section") {
12085
12085
  const skipTo = await parseMdatSection(state);
12086
12086
  return skipTo;
12087
12087
  }
@@ -12468,11 +12468,11 @@ var webReader = {
12468
12468
  }
12469
12469
  return fetchReadWholeAsText(src);
12470
12470
  },
12471
- preload: ({ range: range2, src, logLevel, prefetchCache }) => {
12471
+ preload: ({ range, src, logLevel, prefetchCache }) => {
12472
12472
  if (src instanceof Blob) {
12473
12473
  return;
12474
12474
  }
12475
- return fetchPreload({ range: range2, src, logLevel, prefetchCache });
12475
+ return fetchPreload({ range, src, logLevel, prefetchCache });
12476
12476
  }
12477
12477
  };
12478
12478
  // src/parse-media.ts
@@ -12585,12 +12585,12 @@ var getChunkToSeekTo = ({
12585
12585
  chunks,
12586
12586
  seekToSecondsToProcess
12587
12587
  }) => {
12588
- let duration2 = 0;
12588
+ let duration = 0;
12589
12589
  for (let i = 0;i < chunks.length; i++) {
12590
- if (duration2 >= seekToSecondsToProcess) {
12590
+ if (duration >= seekToSecondsToProcess) {
12591
12591
  return Math.max(0, i - 1);
12592
12592
  }
12593
- duration2 += chunks[i].duration;
12593
+ duration += chunks[i].duration;
12594
12594
  }
12595
12595
  return Math.max(0, chunks.length - 1);
12596
12596
  };
@@ -13280,11 +13280,11 @@ var getAudioSampleFromCbr = ({
13280
13280
  const durationInSeconds = samplesPerFrame / sampleRate;
13281
13281
  const timeInSeconds = nthFrame * samplesPerFrame / sampleRate;
13282
13282
  const timestamp = Math.floor(timeInSeconds * WEBCODECS_TIMESCALE);
13283
- const duration2 = Math.floor(durationInSeconds * WEBCODECS_TIMESCALE);
13283
+ const duration = Math.floor(durationInSeconds * WEBCODECS_TIMESCALE);
13284
13284
  const audioSample = {
13285
13285
  data,
13286
13286
  decodingTimestamp: timestamp,
13287
- duration: duration2,
13287
+ duration,
13288
13288
  offset: initialOffset,
13289
13289
  timestamp,
13290
13290
  type: "key"
@@ -13324,11 +13324,11 @@ var getAudioSampleFromVbr = ({
13324
13324
  });
13325
13325
  const durationInSeconds = samplesPerFrame / info.xingData.sampleRate;
13326
13326
  const timestamp = Math.floor(timeInSeconds * WEBCODECS_TIMESCALE);
13327
- const duration2 = Math.floor(durationInSeconds * WEBCODECS_TIMESCALE);
13327
+ const duration = Math.floor(durationInSeconds * WEBCODECS_TIMESCALE);
13328
13328
  const audioSample = {
13329
13329
  data,
13330
13330
  decodingTimestamp: timestamp,
13331
- duration: duration2,
13331
+ duration,
13332
13332
  offset: position,
13333
13333
  timestamp,
13334
13334
  type: "key"
@@ -13816,7 +13816,7 @@ var parseStrh = ({
13816
13816
  }
13817
13817
  const flags = iterator.getUint32Le();
13818
13818
  const priority = iterator.getUint16Le();
13819
- const language2 = iterator.getUint16Le();
13819
+ const language = iterator.getUint16Le();
13820
13820
  const initialFrames = iterator.getUint32Le();
13821
13821
  const scale = iterator.getUint32Le();
13822
13822
  const rate = iterator.getUint32Le();
@@ -13849,7 +13849,7 @@ var parseStrh = ({
13849
13849
  scale,
13850
13850
  start,
13851
13851
  suggestedBufferSize,
13852
- language: language2,
13852
+ language,
13853
13853
  strf
13854
13854
  };
13855
13855
  };
@@ -14086,8 +14086,8 @@ var parseMediaSection = async (state) => {
14086
14086
  await parseMovi({
14087
14087
  state
14088
14088
  });
14089
- const tracks2 = getTracks(state, false);
14090
- if (!tracks2.some((t) => t.type === "video" && t.codec === TO_BE_OVERRIDDEN_LATER) && !state.callbacks.tracks.getIsDone()) {
14089
+ const tracks = getTracks(state, false);
14090
+ if (!tracks.some((t) => t.type === "video" && t.codec === TO_BE_OVERRIDDEN_LATER) && !state.callbacks.tracks.getIsDone()) {
14091
14091
  state.callbacks.tracks.setIsDone(state.logLevel);
14092
14092
  }
14093
14093
  };
@@ -14434,7 +14434,7 @@ var readAdtsHeader = (buffer) => {
14434
14434
  const sampleRate = getSampleRateFromSampleFrequencyIndex(samplingFrequencyIndex);
14435
14435
  iterator.getBits(1);
14436
14436
  const channelConfiguration = iterator.getBits(3);
14437
- const codecPrivate2 = createAacCodecPrivate({
14437
+ const codecPrivate = createAacCodecPrivate({
14438
14438
  audioObjectType,
14439
14439
  sampleRate,
14440
14440
  channelConfiguration,
@@ -14454,7 +14454,7 @@ var readAdtsHeader = (buffer) => {
14454
14454
  iterator.destroy();
14455
14455
  return {
14456
14456
  frameLength,
14457
- codecPrivate: codecPrivate2,
14457
+ codecPrivate,
14458
14458
  channelConfiguration,
14459
14459
  sampleRate,
14460
14460
  audioObjectType
@@ -14476,7 +14476,7 @@ var handleAacPacket = async ({
14476
14476
  if (!adtsHeader) {
14477
14477
  throw new Error("Invalid ADTS header - too short");
14478
14478
  }
14479
- const { channelConfiguration, codecPrivate: codecPrivate2, sampleRate, audioObjectType } = adtsHeader;
14479
+ const { channelConfiguration, codecPrivate, sampleRate, audioObjectType } = adtsHeader;
14480
14480
  const isTrackRegistered = sampleCallbacks.tracks.getTracks().find((t) => {
14481
14481
  return t.trackId === programId;
14482
14482
  });
@@ -14488,12 +14488,12 @@ var handleAacPacket = async ({
14488
14488
  });
14489
14489
  const track = {
14490
14490
  type: "audio",
14491
- codecData: { type: "aac-config", data: codecPrivate2 },
14491
+ codecData: { type: "aac-config", data: codecPrivate },
14492
14492
  trackId: programId,
14493
14493
  originalTimescale: MPEG_TIMESCALE,
14494
14494
  codecEnum: "aac",
14495
14495
  codec: mapAudioObjectTypeToCodecString(audioObjectType),
14496
- description: codecPrivate2,
14496
+ description: codecPrivate,
14497
14497
  numberOfChannels: channelConfiguration,
14498
14498
  sampleRate,
14499
14499
  startInSeconds: 0,
@@ -15061,18 +15061,18 @@ var CHANNELS = {
15061
15061
  17: "Top Back Right"
15062
15062
  };
15063
15063
  function getChannelsFromMask(channelMask) {
15064
- const channels2 = [];
15064
+ const channels = [];
15065
15065
  for (let bit = 0;bit < 18; bit++) {
15066
15066
  if ((channelMask & 1 << bit) !== 0) {
15067
15067
  const channelName = CHANNELS[bit];
15068
15068
  if (channelName) {
15069
- channels2.push(channelName);
15069
+ channels.push(channelName);
15070
15070
  } else {
15071
- channels2.push(`Unknown Channel (bit ${bit})`);
15071
+ channels.push(`Unknown Channel (bit ${bit})`);
15072
15072
  }
15073
15073
  }
15074
15074
  }
15075
- return channels2;
15075
+ return channels;
15076
15076
  }
15077
15077
  var parseFmt = async ({
15078
15078
  state
@@ -15116,8 +15116,8 @@ var parseFmt = async ({
15116
15116
  if (subformatIsPcm(subFormat)) {} else if (subformatIsIeeeFloat(subFormat)) {} else {
15117
15117
  throw new Error(`Unsupported subformat: ${subFormat}`);
15118
15118
  }
15119
- const channels2 = getChannelsFromMask(channelMask);
15120
- wavHeader.numberOfChannels = channels2.length;
15119
+ const channels = getChannelsFromMask(channelMask);
15120
+ wavHeader.numberOfChannels = channels.length;
15121
15121
  }
15122
15122
  await registerAudioTrack({
15123
15123
  track: {
@@ -15240,14 +15240,14 @@ var parseMediaSection2 = async ({
15240
15240
  throw new Error("Expected fmt box");
15241
15241
  }
15242
15242
  const toRead = Math.min(maxRead, fmtBox.sampleRate * fmtBox.blockAlign / WAVE_SAMPLES_PER_SECOND);
15243
- const duration2 = toRead / (fmtBox.sampleRate * fmtBox.blockAlign);
15243
+ const duration = toRead / (fmtBox.sampleRate * fmtBox.blockAlign);
15244
15244
  const timestamp = (offset - videoSection.start) / (fmtBox.sampleRate * fmtBox.blockAlign);
15245
15245
  const data = iterator.getSlice(toRead);
15246
15246
  const audioSample = convertAudioOrVideoSampleToWebCodecsTimestamps({
15247
15247
  sample: {
15248
15248
  decodingTimestamp: timestamp,
15249
15249
  data,
15250
- duration: duration2,
15250
+ duration,
15251
15251
  timestamp,
15252
15252
  type: "key",
15253
15253
  offset
@@ -15306,19 +15306,19 @@ var getByteForSeek = ({
15306
15306
  if (v.type !== "Seek") {
15307
15307
  return null;
15308
15308
  }
15309
- const seekId2 = v.value.find((_v) => {
15309
+ const seekId = v.value.find((_v) => {
15310
15310
  return _v.type === "SeekID" && _v.value === matroskaElements.Cues;
15311
15311
  });
15312
- if (!seekId2) {
15312
+ if (!seekId) {
15313
15313
  return null;
15314
15314
  }
15315
- const seekPosition2 = v.value.find((_v) => {
15315
+ const seekPosition = v.value.find((_v) => {
15316
15316
  return _v.type === "SeekPosition";
15317
15317
  });
15318
- if (!seekPosition2) {
15318
+ if (!seekPosition) {
15319
15319
  return false;
15320
15320
  }
15321
- return seekPosition2.value;
15321
+ return seekPosition.value;
15322
15322
  }).filter(truthy);
15323
15323
  if (value.length === 0) {
15324
15324
  return null;
@@ -15362,9 +15362,9 @@ var parseBlockFlags = (iterator, type) => {
15362
15362
  var addAvcToTrackAndActivateTrackIfNecessary = async ({
15363
15363
  partialVideoSample,
15364
15364
  codec,
15365
- structureState: structureState2,
15365
+ structureState,
15366
15366
  webmState,
15367
- trackNumber: trackNumber2,
15367
+ trackNumber,
15368
15368
  logLevel,
15369
15369
  callbacks,
15370
15370
  onVideoTrack,
@@ -15374,7 +15374,7 @@ var addAvcToTrackAndActivateTrackIfNecessary = async ({
15374
15374
  return;
15375
15375
  }
15376
15376
  const missingTracks = getTracksFromMatroska({
15377
- structureState: structureState2,
15377
+ structureState,
15378
15378
  webmState
15379
15379
  }).missingInfo;
15380
15380
  if (missingTracks.length === 0) {
@@ -15383,18 +15383,18 @@ var addAvcToTrackAndActivateTrackIfNecessary = async ({
15383
15383
  const parsed = parseAvc(partialVideoSample.data, avcState);
15384
15384
  for (const parse of parsed) {
15385
15385
  if (parse.type === "avc-profile") {
15386
- webmState.setAvcProfileForTrackNumber(trackNumber2, parse);
15387
- const track = missingTracks.find((t) => t.trackId === trackNumber2);
15386
+ webmState.setAvcProfileForTrackNumber(trackNumber, parse);
15387
+ const track = missingTracks.find((t) => t.trackId === trackNumber);
15388
15388
  if (!track) {
15389
- throw new Error("Could not find track " + trackNumber2);
15389
+ throw new Error("Could not find track " + trackNumber);
15390
15390
  }
15391
15391
  const resolvedTracks = getTracksFromMatroska({
15392
- structureState: structureState2,
15392
+ structureState,
15393
15393
  webmState
15394
15394
  }).resolved;
15395
- const resolvedTrack = resolvedTracks.find((t) => t.trackId === trackNumber2);
15395
+ const resolvedTrack = resolvedTracks.find((t) => t.trackId === trackNumber);
15396
15396
  if (!resolvedTrack) {
15397
- throw new Error("Could not find track " + trackNumber2);
15397
+ throw new Error("Could not find track " + trackNumber);
15398
15398
  }
15399
15399
  await registerVideoTrack({
15400
15400
  track: resolvedTrack,
@@ -15411,7 +15411,7 @@ var getSampleFromBlock = async ({
15411
15411
  ebml,
15412
15412
  webmState,
15413
15413
  offset,
15414
- structureState: structureState2,
15414
+ structureState,
15415
15415
  callbacks,
15416
15416
  logLevel,
15417
15417
  onVideoTrack,
@@ -15422,13 +15422,13 @@ var getSampleFromBlock = async ({
15422
15422
  maxBytes: ebml.value.length,
15423
15423
  logLevel: "error"
15424
15424
  });
15425
- const trackNumber2 = iterator.getVint();
15426
- if (trackNumber2 === null) {
15425
+ const trackNumber = iterator.getVint();
15426
+ if (trackNumber === null) {
15427
15427
  throw new Error("Not enough data to get track number, should not happen");
15428
15428
  }
15429
15429
  const timecodeRelativeToCluster = iterator.getInt16();
15430
15430
  const { keyframe } = parseBlockFlags(iterator, ebml.type === "SimpleBlock" ? matroskaElements.SimpleBlock : matroskaElements.Block);
15431
- const { codec, trackTimescale } = webmState.getTrackInfoByNumber(trackNumber2);
15431
+ const { codec, trackTimescale } = webmState.getTrackInfoByNumber(trackNumber);
15432
15432
  const clusterOffset = webmState.getTimestampOffsetForByteOffset(offset);
15433
15433
  const timescale = webmState.getTimescale();
15434
15434
  if (clusterOffset === undefined) {
@@ -15437,7 +15437,7 @@ var getSampleFromBlock = async ({
15437
15437
  const timecodeInNanoSeconds = (timecodeRelativeToCluster + clusterOffset) * timescale * (trackTimescale ?? 1);
15438
15438
  const timecodeInMicroseconds = timecodeInNanoSeconds / 1000;
15439
15439
  if (!codec) {
15440
- throw new Error(`Could not find codec for track ${trackNumber2}`);
15440
+ throw new Error(`Could not find codec for track ${trackNumber}`);
15441
15441
  }
15442
15442
  const remainingNow = ebml.value.length - iterator.counter.getOffset();
15443
15443
  if (codec.startsWith("V_")) {
@@ -15453,16 +15453,16 @@ var getSampleFromBlock = async ({
15453
15453
  return {
15454
15454
  type: "partial-video-sample",
15455
15455
  partialVideoSample,
15456
- trackId: trackNumber2,
15456
+ trackId: trackNumber,
15457
15457
  timescale: WEBCODECS_TIMESCALE
15458
15458
  };
15459
15459
  }
15460
15460
  await addAvcToTrackAndActivateTrackIfNecessary({
15461
15461
  codec,
15462
15462
  partialVideoSample,
15463
- structureState: structureState2,
15463
+ structureState,
15464
15464
  webmState,
15465
- trackNumber: trackNumber2,
15465
+ trackNumber,
15466
15466
  callbacks,
15467
15467
  logLevel,
15468
15468
  onVideoTrack,
@@ -15476,7 +15476,7 @@ var getSampleFromBlock = async ({
15476
15476
  return {
15477
15477
  type: "video-sample",
15478
15478
  videoSample: sample,
15479
- trackId: trackNumber2,
15479
+ trackId: trackNumber,
15480
15480
  timescale: WEBCODECS_TIMESCALE
15481
15481
  };
15482
15482
  }
@@ -15493,7 +15493,7 @@ var getSampleFromBlock = async ({
15493
15493
  return {
15494
15494
  type: "audio-sample",
15495
15495
  audioSample,
15496
- trackId: trackNumber2,
15496
+ trackId: trackNumber,
15497
15497
  timescale: WEBCODECS_TIMESCALE
15498
15498
  };
15499
15499
  }
@@ -15605,7 +15605,7 @@ var postprocessEbml = async ({
15605
15605
  logLevel,
15606
15606
  onAudioTrack,
15607
15607
  onVideoTrack,
15608
- structureState: structureState2,
15608
+ structureState,
15609
15609
  avcState
15610
15610
  }
15611
15611
  }) => {
@@ -15652,7 +15652,7 @@ var postprocessEbml = async ({
15652
15652
  ebml,
15653
15653
  webmState,
15654
15654
  offset,
15655
- structureState: structureState2,
15655
+ structureState,
15656
15656
  callbacks,
15657
15657
  logLevel,
15658
15658
  onVideoTrack,
@@ -15689,16 +15689,16 @@ var postprocessEbml = async ({
15689
15689
  }
15690
15690
  }
15691
15691
  if (ebml.type === "BlockGroup") {
15692
- const block2 = ebml.value.find((c) => c.type === "SimpleBlock" || c.type === "Block");
15693
- if (!block2 || block2.type !== "SimpleBlock" && block2.type !== "Block") {
15692
+ const block = ebml.value.find((c) => c.type === "SimpleBlock" || c.type === "Block");
15693
+ if (!block || block.type !== "SimpleBlock" && block.type !== "Block") {
15694
15694
  throw new Error("Expected block segment");
15695
15695
  }
15696
15696
  const hasReferenceBlock = ebml.value.find((c) => c.type === "ReferenceBlock");
15697
- const sample = block2.value.length === 0 ? null : await getSampleFromBlock({
15698
- ebml: block2,
15697
+ const sample = block.value.length === 0 ? null : await getSampleFromBlock({
15698
+ ebml: block,
15699
15699
  webmState,
15700
15700
  offset,
15701
- structureState: structureState2,
15701
+ structureState,
15702
15702
  callbacks,
15703
15703
  logLevel,
15704
15704
  onVideoTrack,
@@ -15729,7 +15729,7 @@ var expectSegment = async ({
15729
15729
  isInsideSegment,
15730
15730
  iterator,
15731
15731
  logLevel,
15732
- mediaSectionState: mediaSectionState2
15732
+ mediaSectionState
15733
15733
  }) => {
15734
15734
  if (iterator.bytesRemaining() === 0) {
15735
15735
  throw new Error("has no bytes");
@@ -15772,8 +15772,8 @@ var expectSegment = async ({
15772
15772
  if (!statesForProcessing) {
15773
15773
  throw new Error("States for processing are required");
15774
15774
  }
15775
- if (mediaSectionState2) {
15776
- mediaSectionState2.addMediaSection({
15775
+ if (mediaSectionState) {
15776
+ mediaSectionState.addMediaSection({
15777
15777
  start: offset,
15778
15778
  size
15779
15779
  });
@@ -15923,8 +15923,8 @@ var initVideo = async ({ state }) => {
15923
15923
  if (!moovAtom) {
15924
15924
  throw new Error("No moov box found");
15925
15925
  }
15926
- const tracks2 = getTracksFromMoovBox(moovAtom);
15927
- for (const track of tracks2.filter((t) => t.type === "video")) {
15926
+ const tracks = getTracksFromMoovBox(moovAtom);
15927
+ for (const track of tracks.filter((t) => t.type === "video")) {
15928
15928
  await registerVideoTrack({
15929
15929
  track,
15930
15930
  container: "mp4",
@@ -15934,7 +15934,7 @@ var initVideo = async ({ state }) => {
15934
15934
  tracks: state.callbacks.tracks
15935
15935
  });
15936
15936
  }
15937
- for (const track of tracks2.filter((t) => t.type === "audio")) {
15937
+ for (const track of tracks.filter((t) => t.type === "audio")) {
15938
15938
  await registerAudioTrack({
15939
15939
  track,
15940
15940
  container: "mp4",
@@ -16734,7 +16734,7 @@ var keyframesState = () => {
16734
16734
  }
16735
16735
  keyframes.push(keyframe);
16736
16736
  };
16737
- const getKeyframes2 = () => {
16737
+ const getKeyframes = () => {
16738
16738
  keyframes.sort((a, b) => a.positionInBytes - b.positionInBytes);
16739
16739
  return keyframes;
16740
16740
  };
@@ -16745,7 +16745,7 @@ var keyframesState = () => {
16745
16745
  };
16746
16746
  return {
16747
16747
  addKeyframe,
16748
- getKeyframes: getKeyframes2,
16748
+ getKeyframes,
16749
16749
  setFromSeekingHints
16750
16750
  };
16751
16751
  };
@@ -17139,19 +17139,19 @@ var webmState = ({
17139
17139
  prefetchCache
17140
17140
  }) => {
17141
17141
  const trackEntries = {};
17142
- const onTrackEntrySegment = (trackEntry2) => {
17143
- const trackId = getTrackId(trackEntry2);
17142
+ const onTrackEntrySegment = (trackEntry) => {
17143
+ const trackId = getTrackId(trackEntry);
17144
17144
  if (!trackId) {
17145
17145
  throw new Error("Expected track id");
17146
17146
  }
17147
17147
  if (trackEntries[trackId]) {
17148
17148
  return;
17149
17149
  }
17150
- const codec = getTrackCodec(trackEntry2);
17150
+ const codec = getTrackCodec(trackEntry);
17151
17151
  if (!codec) {
17152
17152
  throw new Error("Expected codec");
17153
17153
  }
17154
- const trackTimescale = getTrackTimestampScale(trackEntry2);
17154
+ const trackTimescale = getTrackTimestampScale(trackEntry);
17155
17155
  trackEntries[trackId] = {
17156
17156
  codec: codec.value,
17157
17157
  trackTimescale: trackTimescale?.value ?? null
@@ -17187,11 +17187,11 @@ var webmState = ({
17187
17187
  const segments = [];
17188
17188
  const clusters = [];
17189
17189
  const avcProfilesMap = {};
17190
- const setAvcProfileForTrackNumber = (trackNumber2, avcProfile) => {
17191
- avcProfilesMap[trackNumber2] = avcProfile;
17190
+ const setAvcProfileForTrackNumber = (trackNumber, avcProfile) => {
17191
+ avcProfilesMap[trackNumber] = avcProfile;
17192
17192
  };
17193
- const getAvcProfileForTrackNumber = (trackNumber2) => {
17194
- return avcProfilesMap[trackNumber2] ?? null;
17193
+ const getAvcProfileForTrackNumber = (trackNumber) => {
17194
+ return avcProfilesMap[trackNumber] ?? null;
17195
17195
  };
17196
17196
  const cues = lazyCuesFetch({
17197
17197
  controller,
@@ -17443,7 +17443,7 @@ var riffKeyframesState = () => {
17443
17443
  keyframes.push(keyframe);
17444
17444
  keyframes.sort((a, b) => a.positionInBytes - b.positionInBytes);
17445
17445
  };
17446
- const getKeyframes2 = () => {
17446
+ const getKeyframes = () => {
17447
17447
  return keyframes;
17448
17448
  };
17449
17449
  const setFromSeekingHints = (keyframesFromHints) => {
@@ -17453,7 +17453,7 @@ var riffKeyframesState = () => {
17453
17453
  };
17454
17454
  return {
17455
17455
  addKeyframe,
17456
- getKeyframes: getKeyframes2,
17456
+ getKeyframes,
17457
17457
  setFromSeekingHints
17458
17458
  };
17459
17459
  };
@@ -17734,9 +17734,9 @@ var samplesObservedState = () => {
17734
17734
  const addVideoSample = (videoSample) => {
17735
17735
  videoSamples.set(videoSample.timestamp, videoSample.data.byteLength);
17736
17736
  const presentationTimeInSeconds = videoSample.timestamp / WEBCODECS_TIMESCALE;
17737
- const duration2 = (videoSample.duration ?? 0) / WEBCODECS_TIMESCALE;
17737
+ const duration = (videoSample.duration ?? 0) / WEBCODECS_TIMESCALE;
17738
17738
  if (largestVideoSample === undefined || presentationTimeInSeconds > largestVideoSample) {
17739
- largestVideoSample = presentationTimeInSeconds + duration2;
17739
+ largestVideoSample = presentationTimeInSeconds + duration;
17740
17740
  }
17741
17741
  if (smallestVideoSample === undefined || presentationTimeInSeconds < smallestVideoSample) {
17742
17742
  smallestVideoSample = presentationTimeInSeconds;
@@ -17745,15 +17745,15 @@ var samplesObservedState = () => {
17745
17745
  const addAudioSample = (audioSample) => {
17746
17746
  audioSamples.set(audioSample.timestamp, audioSample.data.byteLength);
17747
17747
  const presentationTimeInSeconds = audioSample.timestamp / WEBCODECS_TIMESCALE;
17748
- const duration2 = (audioSample.duration ?? 0) / WEBCODECS_TIMESCALE;
17748
+ const duration = (audioSample.duration ?? 0) / WEBCODECS_TIMESCALE;
17749
17749
  if (largestAudioSample === undefined || presentationTimeInSeconds > largestAudioSample) {
17750
- largestAudioSample = presentationTimeInSeconds + duration2;
17750
+ largestAudioSample = presentationTimeInSeconds + duration;
17751
17751
  }
17752
17752
  if (smallestAudioSample === undefined || presentationTimeInSeconds < smallestAudioSample) {
17753
17753
  smallestAudioSample = presentationTimeInSeconds;
17754
17754
  }
17755
17755
  };
17756
- const getFps2 = () => {
17756
+ const getFps = () => {
17757
17757
  const videoDuration = (largestVideoSample ?? 0) - (smallestVideoSample ?? 0);
17758
17758
  if (videoDuration === 0) {
17759
17759
  return 0;
@@ -17785,7 +17785,7 @@ var samplesObservedState = () => {
17785
17785
  addVideoSample,
17786
17786
  addAudioSample,
17787
17787
  getSlowDurationInSeconds,
17788
- getFps: getFps2,
17788
+ getFps,
17789
17789
  getSlowNumberOfFrames,
17790
17790
  getAudioBitrate,
17791
17791
  getVideoBitrate,
@@ -18195,44 +18195,44 @@ var internalParseMedia = async function({
18195
18195
  contentLength: state.contentLength,
18196
18196
  aacState: state.aac
18197
18197
  })));
18198
- controller._internals.attachSimulateSeekResolution((seek2) => {
18198
+ controller._internals.attachSimulateSeekResolution((seek) => {
18199
18199
  const {
18200
- aacState: aacState2,
18201
- avcState: avcState2,
18202
- flacState: flacState2,
18200
+ aacState,
18201
+ avcState,
18202
+ flacState,
18203
18203
  isoState,
18204
18204
  iterator,
18205
18205
  keyframes,
18206
- m3uState: m3uState2,
18206
+ m3uState,
18207
18207
  mediaSection,
18208
18208
  mp3State,
18209
18209
  riffState,
18210
18210
  samplesObserved,
18211
- structureState: structureState2,
18211
+ structureState,
18212
18212
  tracksState,
18213
18213
  transportStream,
18214
- webmState: webmState2
18214
+ webmState
18215
18215
  } = getWorkOnSeekRequestOptions(state);
18216
18216
  return turnSeekIntoByte({
18217
- aacState: aacState2,
18218
- seek: seek2,
18219
- avcState: avcState2,
18217
+ aacState,
18218
+ seek,
18219
+ avcState,
18220
18220
  contentLength,
18221
- flacState: flacState2,
18221
+ flacState,
18222
18222
  isoState,
18223
18223
  iterator,
18224
18224
  keyframes,
18225
18225
  logLevel,
18226
18226
  m3uPlaylistContext,
18227
- m3uState: m3uState2,
18227
+ m3uState,
18228
18228
  mediaSectionState: mediaSection,
18229
18229
  mp3State,
18230
18230
  riffState,
18231
18231
  samplesObserved,
18232
- structureState: structureState2,
18232
+ structureState,
18233
18233
  tracksState,
18234
18234
  transportStream,
18235
- webmState: webmState2
18235
+ webmState
18236
18236
  });
18237
18237
  });
18238
18238
  if (!hasAudioTrackHandlers && !hasVideoTrackHandlers && Object.values(state.fields).every((v) => !v) && mode === "query") {
@@ -18624,10 +18624,10 @@ var startParsing = async (message, reader) => {
18624
18624
  value: structure
18625
18625
  });
18626
18626
  } : null,
18627
- onTracks: postTracks ? async (tracks2) => {
18627
+ onTracks: postTracks ? async (tracks) => {
18628
18628
  await executeCallback({
18629
18629
  callbackType: "tracks",
18630
- value: tracks2
18630
+ value: tracks
18631
18631
  });
18632
18632
  } : null,
18633
18633
  onUnrotatedDimensions: postUnrotatedDimensions ? async (dimensions) => {