[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.
This commit is contained in:
chme 2015-11-01 11:59:39 +01:00
parent abc689a7e1
commit 7b5c80acf4

View File

@ -460,8 +460,8 @@ queue_next(struct queue *queue, unsigned int item_id, char shuffle, enum repeat_
item = queueitem_get_byitemid(queue, item_id); item = queueitem_get_byitemid(queue, item_id);
if (!item) if (!item)
// Item not found // Item not found, start playing from the start of the queue
return NULL; item = queue->head;
if (r_mode == REPEAT_SONG && item != queue->head) if (r_mode == REPEAT_SONG && item != queue->head)
return item; return item;