summaryrefslogtreecommitdiff
path: root/streamer.c
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <wakeroid@gmail.com>2010-05-09 13:23:38 +0200
committerGravatar Alexey Yakovenko <wakeroid@gmail.com>2010-05-09 13:23:38 +0200
commit124dcfdf666484c0797d25b37c08999404eda026 (patch)
tree9648419ddab8d1dd3fbe71f85a5e09cf43064c33 /streamer.c
parent1b79344476e2050a80f1b190ecb0ad8665c49318 (diff)
fixed shuffle in don't loop mode
Diffstat (limited to 'streamer.c')
-rw-r--r--streamer.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/streamer.c b/streamer.c
index 818e5fc9..1b5f3516 100644
--- a/streamer.c
+++ b/streamer.c
@@ -329,13 +329,16 @@ streamer_move_to_nextsong (int reason) {
}
playItem_t *it = pmin;
if (!it) {
- trace ("all songs played! reshuffle\n");
// all songs played, reshuffle and try again
- if (pl_loop_mode == PLAYBACK_MODE_LOOP_ALL) { // loop
+ if (pl_loop_mode == PLAYBACK_MODE_LOOP_ALL || reason == 1) { // loop
+ trace ("all songs played! reshuffle\n");
plt_reshuffle (streamer_playlist, &it, NULL);
}
}
if (!it) {
+ playItem_t *temp;
+ plt_reshuffle (streamer_playlist, &temp, NULL);
+ streamer_set_nextsong (-2, 1);
pl_global_unlock ();
return -1;
}
@@ -890,7 +893,7 @@ streamer_thread (void *ctx) {
dec = plug_get_decoder_for_id (streaming_track->decoder_id);
if (dec) {
fileinfo = dec->open ();
- if (fileinfo && dec->init (fileinfo, DB_PLAYITEM (streaming_track) < 0)) {
+ if (fileinfo && dec->init (fileinfo, DB_PLAYITEM (streaming_track)) < 0) {
dec->free (fileinfo);
fileinfo = NULL;
}