mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2024-11-10 09:07:45 +01:00
Fix segments with small gaps
This commit is contained in:
parent
9a7baa7325
commit
c61c97ccad
1 changed files with 3 additions and 2 deletions
|
@ -545,6 +545,7 @@ function startSponsorSchedule(includeIntersectingSegments = false, currentTime?:
|
|||
// Don't skip if this category should not be skipped
|
||||
if (!shouldSkip(currentSkip) && !sponsorTimesSubmitting?.some((segment) => segment.segment === currentSkip.segment)) return;
|
||||
|
||||
const skipBuffer = 0.003;
|
||||
const skippingFunction = (forceVideoTime?: number) => {
|
||||
let forcedSkipTime: number = null;
|
||||
let forcedIncludeIntersectingSegments = false;
|
||||
|
@ -553,7 +554,7 @@ function startSponsorSchedule(includeIntersectingSegments = false, currentTime?:
|
|||
if (incorrectVideoCheck(videoID, currentSkip)) return;
|
||||
forceVideoTime ||= Math.max(video.currentTime, getVirtualTime());
|
||||
|
||||
if (forceVideoTime >= skipTime[0] && forceVideoTime < skipTime[1]) {
|
||||
if (forceVideoTime >= skipTime[0] - skipBuffer && forceVideoTime < skipTime[1]) {
|
||||
skipToTime({
|
||||
v: video,
|
||||
skipTime,
|
||||
|
@ -574,7 +575,7 @@ function startSponsorSchedule(includeIntersectingSegments = false, currentTime?:
|
|||
startSponsorSchedule(forcedIncludeIntersectingSegments, forcedSkipTime, forcedIncludeNonIntersectingSegments);
|
||||
};
|
||||
|
||||
if (timeUntilSponsor < 0.003) {
|
||||
if (timeUntilSponsor < skipBuffer) {
|
||||
skippingFunction(currentTime);
|
||||
} else {
|
||||
const delayTime = timeUntilSponsor * 1000 * (1 / video.playbackRate);
|
||||
|
|
Loading…
Reference in a new issue