Fix fast-forward at end of episode (#6074)

When using variable speed, skipping back and forth introduces some
uncertainty to the current position, causing skip-forward to try to skip
to an invalid position when very near the end of the episode. This
change fixes this by skipping the current episode if the desired
skip-forward position exceeds the duration.
This commit is contained in:
Erik Johnson 2023-10-29 03:43:20 -05:00 committed by GitHub
parent 346365b8d0
commit 8a011badd3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -343,6 +343,12 @@ public class LocalPSMP extends PlaybackServiceMediaPlayer {
t = 0;
}
if (t >= getDuration()) {
Log.d(TAG, "Seek reached end of file, skipping to next episode");
skip();
return;
}
if (playerStatus == PlayerStatus.PLAYING
|| playerStatus == PlayerStatus.PAUSED
|| playerStatus == PlayerStatus.PREPARED) {