From 3fcf6083908981f9b7195cfc3cae6ddf741890fd Mon Sep 17 00:00:00 2001 From: polymorphicshade Date: Sun, 21 Feb 2021 14:16:12 -0700 Subject: [PATCH] another attempt at fixing skipping for issues going between players (background, etc) --- app/src/main/java/org/schabi/newpipe/player/Player.java | 7 +++++++ 1 file changed, 7 insertions(+) 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 f896bef8c..604063348 100644 --- a/app/src/main/java/org/schabi/newpipe/player/Player.java +++ b/app/src/main/java/org/schabi/newpipe/player/Player.java @@ -701,6 +701,8 @@ public final class Player implements // (to disable/enable video stream or to set quality) setRecovery(); reloadPlayQueueManager(); + stopProgressLoop(); + startProgressLoop(); } setupElementsVisibility(); @@ -4256,6 +4258,11 @@ public final class Player implements } public VideoSegment getSkippableSegment(final int progress) { + // currentItem may get set to something later (asynchronously) + if (currentItem == null) { + return null; + } + final VideoSegment[] videoSegments = currentItem.getVideoSegments(); if (videoSegments == null) { return null;