mirror of
https://github.com/owntone/owntone-server.git
synced 2025-02-13 14:48:10 -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 */
|
/* Playlist has only one file, treat REPEAT_ALL as REPEAT_SONG */
|
||||||
if ((r_mode == REPEAT_ALL) && (source_head == source_head->pl_next))
|
if ((r_mode == REPEAT_ALL) && (source_head == source_head->pl_next))
|
||||||
r_mode = REPEAT_SONG;
|
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)
|
if (!cur_streaming)
|
||||||
ps = head;
|
ps = head;
|
||||||
@ -850,8 +855,12 @@ source_check(void)
|
|||||||
{
|
{
|
||||||
i++;
|
i++;
|
||||||
|
|
||||||
/* Stop playback if repeat OFF and at end of playlist */
|
/* Stop playback if:
|
||||||
if ((r_mode == REPEAT_OFF) && (cur_playing->play_next == head))
|
* - 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);
|
playback_stop(NULL);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user