mirror of
https://github.com/owntone/owntone-server.git
synced 2025-02-04 10:26:02 -05:00
Fix REPEAT_OFF behaviour on single-item playlists
This commit is contained in:
parent
576e1cc9ef
commit
143b612c97
13
src/player.c
13
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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user