diff --git a/app/src/main/java/org/schabi/newpipe/player/Player.java b/app/src/main/java/org/schabi/newpipe/player/Player.java index 4f0d2490d..60f6612f7 100644 --- a/app/src/main/java/org/schabi/newpipe/player/Player.java +++ b/app/src/main/java/org/schabi/newpipe/player/Player.java @@ -1056,7 +1056,10 @@ private void triggerCheckForSponsorBlockSegments(final int currentProgress, seekTo(skipTarget); simpleExoPlayer.setSeekParameters(seekParams); - lastSegment = sponsorBlockSegment; + if (!isRewind || isGracedRewind) { + // DO NOT TRACK for non-graced rewinds to work, BUT always track for graced + lastSegment = sponsorBlockSegment; + } if (isUnSkip) { return; @@ -1881,6 +1884,7 @@ public void fastRewind() { return; } + destroyUnskipVars(); // destroy, else rewind into segment won't skip triggerProgressUpdate(true); } //endregion @@ -2502,12 +2506,7 @@ public Optional getSkippableSponsorBlockSegment(final int p && progress > lastSegment.endTime + UNSKIP_WINDOW_MILLIS) { // un-skip window is over hideUnskipButtons(); - lastSegment = null; - autoSkipGracePeriod = false; - - if (DEBUG) { - Log.d("SPONSOR_BLOCK", "Destroyed last segment variables (UNSKIP)"); - } + destroyUnskipVars(); } else if (lastSegment != null && progress < lastSegment.endTime + UNSKIP_WINDOW_MILLIS && progress >= lastSegment.startTime) { @@ -2528,6 +2527,15 @@ private void hideUnskipButtons() { UIs.call(PlayerUi::hideAutoUnskip); } + private void destroyUnskipVars() { + lastSegment = null; + autoSkipGracePeriod = false; + + if (DEBUG) { + Log.d("SPONSOR_BLOCK", "Destroyed last segment variables (UNSKIP)"); + } + } + private SponsorBlockSecondaryMode getSecondaryMode(final SponsorBlockSegment segment) { if (segment == null) { return SponsorBlockSecondaryMode.DISABLED;