From 10fceb6d3fde536c138dcb22cd546a6f749be75f Mon Sep 17 00:00:00 2001 From: chme Date: Sat, 21 Nov 2015 09:16:50 +0100 Subject: [PATCH 1/3] [mpd] Fix segfault executing "decoders" command --- src/mpd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mpd.c b/src/mpd.c index 7470097b..d1544344 100644 --- a/src/mpd.c +++ b/src/mpd.c @@ -3480,7 +3480,7 @@ mpd_command_decoders(struct evbuffer *evbuf, int argc, char **argv, char **errms evbuffer_add_printf(evbuf, "suffix: %s\n", ffmpeg_suffixes[i]); } - for (i = 0; ffmpeg_suffixes[i]; i++) + for (i = 0; ffmpeg_mime_types[i]; i++) { evbuffer_add_printf(evbuf, "mime_type: %s\n", ffmpeg_mime_types[i]); } From 8fc8d08b42ce6bb919d3d592291aa1950faccf0b Mon Sep 17 00:00:00 2001 From: chme Date: Sat, 21 Nov 2015 10:08:54 +0100 Subject: [PATCH 2/3] [player] Add missing notification of playlist changes after removing an item from the playlist --- src/player.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/player.c b/src/player.c index 8c28a7e4..daf0d7ef 100644 --- a/src/player.c +++ b/src/player.c @@ -3483,6 +3483,10 @@ playerqueue_remove_bypos(struct player_command *cmd) DPRINTF(E_DBG, L_PLAYER, "Removing item from position %d\n", pos); queue_remove_bypos(queue, ps_playing->item_id, pos, shuffle); + cur_plversion++; + + listener_notify(LISTENER_PLAYLIST); + return 0; } @@ -3501,6 +3505,10 @@ playerqueue_remove_byitemid(struct player_command *cmd) DPRINTF(E_DBG, L_PLAYER, "Removing item with id %d\n", id); queue_remove_byitemid(queue, id); + cur_plversion++; + + listener_notify(LISTENER_PLAYLIST); + return 0; } From 6d720dec943eb2438346284a9cda9ec3136197e0 Mon Sep 17 00:00:00 2001 From: chme Date: Sun, 22 Nov 2015 07:08:59 +0100 Subject: [PATCH 3/3] [queue] Ignore moving an item to its current position (would results in an invalid queue) --- src/queue.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/queue.c b/src/queue.c index 688e3098..424ae197 100644 --- a/src/queue.c +++ b/src/queue.c @@ -787,10 +787,17 @@ queue_move_byitemid(struct queue *queue, unsigned int item_id, unsigned int to_p return; } + index = queue_index_byitemid(queue, item_id, shuffle); + + if (index == to_pos) + { + DPRINTF(E_DBG, L_PLAYER, "Ignore moving item %d from index %d to %d\n", item_id, index, to_pos); + return; + } + // Check if the index of the item to move is lower than the target index // If that is the case, increment the target position, because the given to_pos // is based on the queue without the moved item. - index = queue_index_byitemid(queue, item_id, shuffle); if (index < to_pos) to_pos++;