Skip to content

Commit

Permalink
Merge pull request #7381 from litetex/prevent-automatic-replay-after-…
Browse files Browse the repository at this point in the history
…returning-from-background

Prevent automatic replay after returning from background
  • Loading branch information
XiangRongLin authored Nov 17, 2021
2 parents d5199ea + 316db0e commit bd9dcfb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/src/main/java/org/schabi/newpipe/player/Player.java
Original file line number Diff line number Diff line change
Expand Up @@ -857,10 +857,10 @@ public void setRecovery() {

final int queuePos = playQueue.getIndex();
final long windowPos = simpleExoPlayer.getCurrentPosition();
final long duration = simpleExoPlayer.getDuration();

if (windowPos > 0 && windowPos <= simpleExoPlayer.getDuration()) {
setRecovery(queuePos, windowPos);
}
// No checks due to https://github.com/TeamNewPipe/NewPipe/pull/7195#issuecomment-962624380
setRecovery(queuePos, Math.max(0, Math.min(windowPos, duration)));
}

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

0 comments on commit bd9dcfb

Please sign in to comment.