From e3750957f5e5b8d563a7d2a856fee0de12d768c6 Mon Sep 17 00:00:00 2001 From: chme Date: Sat, 5 Mar 2016 08:14:43 +0100 Subject: [PATCH] [player] Allow removing by position (dacp-requests) if player is stopped --- src/player.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/player.c b/src/player.c index f34eedeb..6d18c702 100644 --- a/src/player.c +++ b/src/player.c @@ -3488,6 +3488,7 @@ playerqueue_remove_bypos(struct player_command *cmd) { int pos; struct player_source *ps_playing; + uint32_t item_id; pos = cmd->arg.intval; if (pos < 1) @@ -3500,12 +3501,14 @@ playerqueue_remove_bypos(struct player_command *cmd) if (!ps_playing) { - DPRINTF(E_LOG, L_PLAYER, "Can't remove item at pos %d, no playing item found\n", pos); - return -1; + DPRINTF(E_DBG, L_PLAYER, "No playing item for remove by pos\n"); + item_id = 0; } + else + item_id = ps_playing->item_id; DPRINTF(E_DBG, L_PLAYER, "Removing item from position %d\n", pos); - queue_remove_bypos(queue, ps_playing->item_id, pos, shuffle); + queue_remove_bypos(queue, item_id, pos, shuffle); cur_plversion++;