Merge pull request from chme/fixaddnextforshuffle

Fix queue_add_next command
This commit is contained in:
ejurgensen 2014-04-23 22:39:31 +02:00
commit 40fb55ae40

@ -3374,14 +3374,18 @@ queue_add_next(struct player_command *cmd)
if (source_head) if (source_head)
{ {
ps_playing = cur_playing ? cur_playing : cur_streaming; ps_playing = cur_playing ? cur_playing : cur_streaming;
ps_tail = ps->pl_prev;
ps_tail->pl_next = ps_playing->pl_next; // Insert ps after ps_playing
ps_tail->shuffle_next = ps_playing->shuffle_next; ps->pl_prev->pl_next = ps_playing->pl_next;
ps_playing->pl_next = ps; ps_playing->pl_next->pl_prev = ps->pl_prev;
ps_playing->shuffle_next = ps;
ps->pl_prev = ps_playing; ps->pl_prev = ps_playing;
ps->shuffle_prev = ps_playing; ps_playing->pl_next = ps;
// Insert ps_shuffle after ps_playing
ps_shuffle->shuffle_prev->shuffle_next = ps_playing->shuffle_next;
ps_playing->shuffle_next->shuffle_prev = ps_shuffle->shuffle_prev;
ps_shuffle->shuffle_prev = ps_playing;
ps_playing->shuffle_next = ps_shuffle;
} }
else else
{ {