Skip to content

Commit

Permalink
Fixed an issue where first track is skipped after playback completes.
Browse files Browse the repository at this point in the history
Calling next() and then playback.start() results in two attempts to load a file. The first fails due to the player not being prepared, which then causes onError() to be invoked, which tells the app to skip to the next track.

Resolves timusus#415
  • Loading branch information
timusus committed May 20, 2019
1 parent 9684561 commit c9ae167
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -514,8 +514,9 @@ public void play() {
long duration = playback.getDuration();
if (queueManager.repeatMode != QueueManager.RepeatMode.ONE && duration > 2000 && playback.getPosition() >= duration - 2000) {
next(true);
} else {
playback.start();
}
playback.start();

musicServiceCallbacks.cancelShutdown();
musicServiceCallbacks.updateNotification();
Expand Down

0 comments on commit c9ae167

Please sign in to comment.