From 7b5c80acf48d20d9040d5f17262b45175d19c5ee Mon Sep 17 00:00:00 2001 From: chme Date: Sun, 1 Nov 2015 11:59:39 +0100 Subject: [PATCH] [queue] If the playing item is not in the queue anymore, the next item should be the first item in the queue This solves the problem that after clearing the queue and adding new items while playing, aborts playback when skipped to the next item. --- src/queue.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/queue.c b/src/queue.c index c3cbef62..86e07c53 100644 --- a/src/queue.c +++ b/src/queue.c @@ -460,8 +460,8 @@ queue_next(struct queue *queue, unsigned int item_id, char shuffle, enum repeat_ item = queueitem_get_byitemid(queue, item_id); if (!item) - // Item not found - return NULL; + // Item not found, start playing from the start of the queue + item = queue->head; if (r_mode == REPEAT_SONG && item != queue->head) return item;