From 143b612c978d76325742e41f832beb5ee760baf0 Mon Sep 17 00:00:00 2001 From: Julien BLACHE Date: Sun, 9 May 2010 09:52:09 +0200 Subject: [PATCH] Fix REPEAT_OFF behaviour on single-item playlists --- src/player.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/player.c b/src/player.c index 0d8116c3..e81eef23 100644 --- a/src/player.c +++ b/src/player.c @@ -617,6 +617,11 @@ source_next(int force) /* Playlist has only one file, treat REPEAT_ALL as REPEAT_SONG */ if ((r_mode == REPEAT_ALL) && (source_head == source_head->pl_next)) r_mode = REPEAT_SONG; + /* Playlist has only one file, not a user action, treat as REPEAT_ALL + * and source_check() will stop playback + */ + else if (!force && (r_mode == REPEAT_OFF) && (source_head == source_head->pl_next)) + r_mode = REPEAT_SONG; if (!cur_streaming) ps = head; @@ -850,8 +855,12 @@ source_check(void) { i++; - /* Stop playback if repeat OFF and at end of playlist */ - if ((r_mode == REPEAT_OFF) && (cur_playing->play_next == head)) + /* Stop playback if: + * - at end of playlist (NULL) + * - repeat OFF and at end of playlist (wraparound) + */ + if (!cur_playing->play_next + || ((r_mode == REPEAT_OFF) && (cur_playing->play_next == head))) { playback_stop(NULL);