Fix REPEAT_OFF behaviour on single-item playlists

This commit is contained in:
Julien BLACHE 2010-05-09 09:52:09 +02:00
parent 576e1cc9ef
commit 143b612c97

View File

@ -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);