Skip to content

Commit c9ae167

Browse files
committed
Fixed an issue where first track is skipped after playback completes.
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
1 parent 9684561 commit c9ae167

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

app/src/main/java/com/simplecity/amp_library/playback/PlaybackManager.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,8 +514,9 @@ public void play() {
514514
long duration = playback.getDuration();
515515
if (queueManager.repeatMode != QueueManager.RepeatMode.ONE && duration > 2000 && playback.getPosition() >= duration - 2000) {
516516
next(true);
517+
} else {
518+
playback.start();
517519
}
518-
playback.start();
519520

520521
musicServiceCallbacks.cancelShutdown();
521522
musicServiceCallbacks.updateNotification();

0 commit comments

Comments
 (0)