hls.js 1.6.0-beta.1.0.canary.10810 → 1.6.0-beta.1.0.canary.10811

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.
package/dist/hls.mjs CHANGED
@@ -400,7 +400,7 @@ function enableLogs(debugConfig, context, id) {
400
400
  // Some browsers don't allow to use bind on console object anyway
401
401
  // fallback to default if needed
402
402
  try {
403
- newLogger.log(`Debug logs enabled for "${context}" in hls.js version ${"1.6.0-beta.1.0.canary.10810"}`);
403
+ newLogger.log(`Debug logs enabled for "${context}" in hls.js version ${"1.6.0-beta.1.0.canary.10811"}`);
404
404
  } catch (e) {
405
405
  /* log fn threw an exception. All logger methods are no-ops. */
406
406
  return createLogger();
@@ -9835,7 +9835,7 @@ var eventemitter3 = {exports: {}};
9835
9835
  var eventemitter3Exports = eventemitter3.exports;
9836
9836
  var EventEmitter = /*@__PURE__*/getDefaultExportFromCjs(eventemitter3Exports);
9837
9837
 
9838
- const version = "1.6.0-beta.1.0.canary.10810";
9838
+ const version = "1.6.0-beta.1.0.canary.10811";
9839
9839
 
9840
9840
  // ensure the worker ends up in the bundle
9841
9841
  // If the worker should not be included this gets aliased to empty.js
@@ -14346,19 +14346,23 @@ class MP4Remuxer {
14346
14346
  this.videoTrackConfig = undefined;
14347
14347
  }
14348
14348
  getVideoStartPts(videoSamples) {
14349
+ // Get the minimum PTS value relative to the first sample's PTS, normalized for 33-bit wrapping
14349
14350
  let rolloverDetected = false;
14351
+ const firstPts = videoSamples[0].pts;
14350
14352
  const startPTS = videoSamples.reduce((minPTS, sample) => {
14351
- const delta = sample.pts - minPTS;
14353
+ let pts = sample.pts;
14354
+ let delta = pts - minPTS;
14352
14355
  if (delta < -4294967296) {
14353
14356
  // 2^32, see PTSNormalize for reasoning, but we're hitting a rollover here, and we don't want that to impact the timeOffset calculation
14354
14357
  rolloverDetected = true;
14355
- return normalizePts(minPTS, sample.pts);
14356
- } else if (delta > 0) {
14358
+ pts = normalizePts(pts, firstPts);
14359
+ delta = pts - minPTS;
14360
+ }
14361
+ if (delta > 0) {
14357
14362
  return minPTS;
14358
- } else {
14359
- return sample.pts;
14360
14363
  }
14361
- }, videoSamples[0].pts);
14364
+ return pts;
14365
+ }, firstPts);
14362
14366
  if (rolloverDetected) {
14363
14367
  this.logger.debug('PTS rollover detected');
14364
14368
  }