diff options
-rw-r--r-- | handler.c | 2 | ||||
-rw-r--r-- | handler.h | 3 | ||||
-rw-r--r-- | streamer.c | 4 |
3 files changed, 8 insertions, 1 deletions
@@ -50,7 +50,7 @@ typedef struct handler_s { message_t pool[1]; } handler_t; -static void +void handler_reset (handler_t *h) { h->mqueue = NULL; h->mfree = NULL; @@ -33,6 +33,9 @@ struct handler_s * handler_alloc (int queue_size); void +handler_reset (struct handler_s *h); + +void handler_free (struct handler_s *h); int @@ -1359,6 +1359,10 @@ void streamer_set_nextsong (int song, int pstate) { // pthread_t tid = pthread_self (); // assert (tid != streamer_tid); + if (pstate == 0) { + // this is a stop query -- clear the queue + handler_reset (handler); + } streamer_abort_files (); handler_push (handler, STR_EV_PLAY_TRACK_IDX, 0, song, pstate); } |