From 59bc6d4a46fd0bea97cf0b8f0d9d68d382a99fe8 Mon Sep 17 00:00:00 2001 From: Trevor Mears Date: Mon, 29 Dec 2025 18:33:59 -0800 Subject: [PATCH] Increased discontinuity boundary seek --- public/js/components/VideoPlayer.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/public/js/components/VideoPlayer.js b/public/js/components/VideoPlayer.js index 3eaef0f..839e43d 100644 --- a/public/js/components/VideoPlayer.js +++ b/public/js/components/VideoPlayer.js @@ -308,13 +308,15 @@ class VideoPlayer { if (frag && frag.sn !== 'initSegment') { // Check if we crossed a discontinuity boundary using CC (Continuity Counter) if (frag.cc !== undefined && frag.cc !== this.lastDiscontinuity) { + const wasFirstDetection = this.lastDiscontinuity === -1; console.log(`[HLS] Discontinuity detected: CC ${this.lastDiscontinuity} -> ${frag.cc}`); this.lastDiscontinuity = frag.cc; - // Small nudge to help decoder sync (only if playing) - if (!this.video.paused && this.video.currentTime > 0) { - const nudgeAmount = 0.01; - this.video.currentTime += nudgeAmount; + // Skip on first detection (initial load) + if (!wasFirstDetection && !this.video.paused && this.video.currentTime > 0) { + // Seek forward slightly to skip past any corrupted audio frames + console.log('[HLS] Seeking past discontinuity boundary'); + this.video.currentTime += 0.5; } } }