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.js +12 -8
- package/dist/hls.js.map +1 -1
- package/dist/hls.light.js +12 -8
- package/dist/hls.light.js.map +1 -1
- package/dist/hls.light.min.js +1 -1
- package/dist/hls.light.min.js.map +1 -1
- package/dist/hls.light.mjs +12 -8
- package/dist/hls.light.mjs.map +1 -1
- package/dist/hls.min.js +1 -1
- package/dist/hls.min.js.map +1 -1
- package/dist/hls.mjs +12 -8
- package/dist/hls.mjs.map +1 -1
- package/dist/hls.worker.js +1 -1
- package/dist/hls.worker.js.map +1 -1
- package/package.json +1 -1
- package/src/remux/mp4-remuxer.ts +11 -7
package/package.json
CHANGED
package/src/remux/mp4-remuxer.ts
CHANGED
@@ -100,20 +100,24 @@ export default class MP4Remuxer implements Remuxer {
|
|
100
100
|
this.videoTrackConfig = undefined;
|
101
101
|
}
|
102
102
|
|
103
|
-
getVideoStartPts(videoSamples) {
|
103
|
+
getVideoStartPts(videoSamples: VideoSample[]) {
|
104
|
+
// Get the minimum PTS value relative to the first sample's PTS, normalized for 33-bit wrapping
|
104
105
|
let rolloverDetected = false;
|
106
|
+
const firstPts = videoSamples[0].pts;
|
105
107
|
const startPTS = videoSamples.reduce((minPTS, sample) => {
|
106
|
-
|
108
|
+
let pts = sample.pts;
|
109
|
+
let delta = pts - minPTS;
|
107
110
|
if (delta < -4294967296) {
|
108
111
|
// 2^32, see PTSNormalize for reasoning, but we're hitting a rollover here, and we don't want that to impact the timeOffset calculation
|
109
112
|
rolloverDetected = true;
|
110
|
-
|
111
|
-
|
113
|
+
pts = normalizePts(pts, firstPts);
|
114
|
+
delta = pts - minPTS;
|
115
|
+
}
|
116
|
+
if (delta > 0) {
|
112
117
|
return minPTS;
|
113
|
-
} else {
|
114
|
-
return sample.pts;
|
115
118
|
}
|
116
|
-
|
119
|
+
return pts;
|
120
|
+
}, firstPts);
|
117
121
|
if (rolloverDetected) {
|
118
122
|
this.logger.debug('PTS rollover detected');
|
119
123
|
}
|