summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--playlist.c6
-rw-r--r--streamer.c6
2 files changed, 8 insertions, 4 deletions
diff --git a/playlist.c b/playlist.c
index feb7f789..0136caf0 100644
--- a/playlist.c
+++ b/playlist.c
@@ -40,8 +40,8 @@
#define PLAYLIST_MAJOR_VER 1
#define PLAYLIST_MINOR_VER 1
-#define trace(...) { fprintf(stderr, __VA_ARGS__); }
-//#define trace(fmt,...)
+//#define trace(...) { fprintf(stderr, __VA_ARGS__); }
+#define trace(fmt,...)
#define SKIP_BLANK_CUE_TRACKS 1
@@ -761,6 +761,7 @@ pl_nextsong (int reason) {
return 0;
}
else {
+ trace ("pl_next_song: reason=%d, loop=%d\n", reason, pl_loop_mode);
if (reason == 0 && pl_loop_mode == 2) { // song finished, loop mode is "loop 1 track"
int r = pl_get_idx_of (playlist_current_ptr);
streamer_set_nextsong (r, 1);
@@ -780,6 +781,7 @@ pl_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 == 0) { // loop
pl_reshuffle (&it, NULL);
diff --git a/streamer.c b/streamer.c
index dd9d0c14..b6753304 100644
--- a/streamer.c
+++ b/streamer.c
@@ -271,8 +271,10 @@ streamer_thread (uintptr_t ctx) {
int to = orig_streaming_song ? pl_get_idx_of (orig_streaming_song) : -1;
trace ("from=%d, to=%d\n", from, to);
orig_playing_song = orig_streaming_song;
- str_playing_song.played = 1;
- str_playing_song.started_timestamp = time (NULL);
+ if (orig_playing_song) {
+ orig_playing_song->played = 1;
+ orig_playing_song->started_timestamp = time (NULL);
+ }
playlist_current_ptr = orig_playing_song;
// that is needed for playlist drawing
trace ("sending songchanged\n");