Increased discontinuity boundary seek
This commit is contained in:
@@ -308,13 +308,15 @@ class VideoPlayer {
|
|||||||
if (frag && frag.sn !== 'initSegment') {
|
if (frag && frag.sn !== 'initSegment') {
|
||||||
// Check if we crossed a discontinuity boundary using CC (Continuity Counter)
|
// Check if we crossed a discontinuity boundary using CC (Continuity Counter)
|
||||||
if (frag.cc !== undefined && frag.cc !== this.lastDiscontinuity) {
|
if (frag.cc !== undefined && frag.cc !== this.lastDiscontinuity) {
|
||||||
|
const wasFirstDetection = this.lastDiscontinuity === -1;
|
||||||
console.log(`[HLS] Discontinuity detected: CC ${this.lastDiscontinuity} -> ${frag.cc}`);
|
console.log(`[HLS] Discontinuity detected: CC ${this.lastDiscontinuity} -> ${frag.cc}`);
|
||||||
this.lastDiscontinuity = frag.cc;
|
this.lastDiscontinuity = frag.cc;
|
||||||
|
|
||||||
// Small nudge to help decoder sync (only if playing)
|
// Skip on first detection (initial load)
|
||||||
if (!this.video.paused && this.video.currentTime > 0) {
|
if (!wasFirstDetection && !this.video.paused && this.video.currentTime > 0) {
|
||||||
const nudgeAmount = 0.01;
|
// Seek forward slightly to skip past any corrupted audio frames
|
||||||
this.video.currentTime += nudgeAmount;
|
console.log('[HLS] Seeking past discontinuity boundary');
|
||||||
|
this.video.currentTime += 0.5;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user