aboutsummaryrefslogtreecommitdiffstats
path: root/src/playlist.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/playlist.c')
-rw-r--r--src/playlist.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/playlist.c b/src/playlist.c
index ed430bf6e..4bdc0b4a8 100644
--- a/src/playlist.c
+++ b/src/playlist.c
@@ -338,12 +338,11 @@ int getPlaylistNextSong(const struct playlist *playlist)
{
if (playlist->current >= 0)
{
- if (queue_length(&playlist->queue) > 1)
+ if (playlist->current + 1 < (int)queue_length(&playlist->queue))
return queue_order_to_position(&playlist->queue,
playlist->current + 1);
else if (playlist->queue.repeat == 1)
- return queue_order_to_position(&playlist->queue,
- playlist->current);
+ return queue_order_to_position(&playlist->queue, 0);
}
return -1;