Skip to content

Commit 316db0e

Browse files
committed
setRecovery: Remove checks and use Math.min/max
1 parent 010c607 commit 316db0e

1 file changed

Lines changed: 2 additions & 8 deletions

File tree

app/src/main/java/org/schabi/newpipe/player/Player.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -859,14 +859,8 @@ public void setRecovery() {
859859
final long windowPos = simpleExoPlayer.getCurrentPosition();
860860
final long duration = simpleExoPlayer.getDuration();
861861

862-
if (windowPos > 0
863-
// Sometimes (e.g. when the playback ended) the windowPos is a few milliseconds
864-
// higher than the duration. Due to this a little buffer (100ms) was introduced.
865-
// See also https://github.com/TeamNewPipe/NewPipe/pull/7195#issuecomment-962624380
866-
&& windowPos <= duration + 100
867-
) {
868-
setRecovery(queuePos, Math.min(windowPos, duration));
869-
}
862+
// No checks due to https://github.com/TeamNewPipe/NewPipe/pull/7195#issuecomment-962624380
863+
setRecovery(queuePos, Math.max(0, Math.min(windowPos, duration)));
870864
}
871865

872866
private void setRecovery(final int queuePos, final long windowPos) {

0 commit comments

Comments
 (0)