summaryrefslogtreecommitdiff
path: root/streamer.c
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2009-08-11 21:46:09 +0200
committerGravatar waker <wakeroid@gmail.com>2009-08-11 21:46:09 +0200
commitb338d34b68b138f05b2f2ef6feef2df9d08d61bd (patch)
tree3385ea40ad5722f3c9c6f693db2eaaa7e6612ae0 /streamer.c
parent245463dbe00a95e3c1ba3d841e31a63509883915 (diff)
better handling of "end of playlist"
Diffstat (limited to 'streamer.c')
-rw-r--r--streamer.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/streamer.c b/streamer.c
index 4d2973d7..3cfb5ce4 100644
--- a/streamer.c
+++ b/streamer.c
@@ -27,6 +27,8 @@
#include "common.h"
#include "streamer.h"
#include "playback.h"
+#include "messagepump.h"
+#include "messages.h"
static SRC_STATE *src;
static SRC_DATA srcdata;
@@ -83,6 +85,16 @@ streamer_thread (uintptr_t ctx) {
p_pause ();
}
}
+ else if (nextsong == -2) {
+ nextsong = -1;
+ p_stop ();
+ messagepump_push (M_SONGCHANGED, 0, pl_get_idx_of (playlist_current_ptr), -1);
+ continue;
+ }
+ else if (p_isstopped ()) {
+ usleep (3000);
+ continue;
+ }
streamer_lock ();
if (streambuffer_fill < STREAM_BUFFER_SIZE) {
int sz = STREAM_BUFFER_SIZE - streambuffer_fill;