From 677a6e08e3c47de72257ccd03c75a07c4cd63812 Mon Sep 17 00:00:00 2001 From: Alexey Yakovenko Date: Tue, 20 Apr 2010 19:21:55 +0200 Subject: fixed reshuffling playlist that is not current --- playlist.c | 8 ++++++-- playlist.h | 3 +++ streamer.c | 4 ++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/playlist.c b/playlist.c index 24a88729..e4cdaa96 100644 --- a/playlist.c +++ b/playlist.c @@ -2115,9 +2115,8 @@ pl_select_all (void) { GLOBAL_UNLOCK; } - void -pl_reshuffle (playItem_t **ppmin, playItem_t **ppmax) { +plt_reshuffle (playlist_t *playlist, playItem_t **ppmin, playItem_t **ppmax) { GLOBAL_LOCK; playItem_t *pmin = NULL; playItem_t *pmax = NULL; @@ -2140,6 +2139,11 @@ pl_reshuffle (playItem_t **ppmin, playItem_t **ppmax) { GLOBAL_UNLOCK; } +void +pl_reshuffle (playItem_t **ppmin, playItem_t **ppmax) { + plt_reshuffle (playlist, ppmin, ppmax); +} + void pl_delete_all_meta (playItem_t *it) { LOCK; diff --git a/playlist.h b/playlist.h index abd9fc03..2b5d24df 100644 --- a/playlist.h +++ b/playlist.h @@ -224,6 +224,9 @@ pl_load_all (void); void pl_select_all (void); +void +plt_reshuffle (playlist_t *playlist, playItem_t **ppmin, playItem_t **ppmax); + void pl_reshuffle (playItem_t **ppmin, playItem_t **ppmax); diff --git a/streamer.c b/streamer.c index 65d43cf2..94d35f98 100644 --- a/streamer.c +++ b/streamer.c @@ -232,7 +232,7 @@ streamer_move_to_nextsong (int reason) { if (!it) { // all songs played, reshuffle and try again if (pl_loop_mode == PLAYBACK_MODE_LOOP_ALL) { // loop - pl_reshuffle (&it, NULL); + plt_reshuffle (streamer_playlist, &it, NULL); } } if (!it) { @@ -268,7 +268,7 @@ streamer_move_to_nextsong (int reason) { trace ("all songs played! reshuffle\n"); // all songs played, reshuffle and try again if (pl_loop_mode == PLAYBACK_MODE_LOOP_ALL) { // loop - pl_reshuffle (&it, NULL); + plt_reshuffle (streamer_playlist, &it, NULL); } } if (!it) { -- cgit v1.2.3