From 873482d352e0f9086b08b7b047b4b8491f451163 Mon Sep 17 00:00:00 2001 From: jdgordon Date: Thu, 21 Jan 2010 07:28:37 +0000 Subject: [PATCH] fix FS#10288 by Tomasz Kowalczyk. Fixes issues where resuming a "insert shuffled" playlist doesnt recreate the same playlist that was stopped.. (I'm tipsy still... read the task for more info :p ) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24303 a1c6a512-1295-4272-9138-f99709370657 --- apps/playlist.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/apps/playlist.c b/apps/playlist.c index 133820ebc..fd34cbe0c 100644 --- a/apps/playlist.c +++ b/apps/playlist.c @@ -783,15 +783,16 @@ static int add_track_to_playlist(struct playlist_info* playlist, } /* update stored indices if needed */ - if (playlist->amount > 0 && insert_position <= playlist->index && - playlist->started) - playlist->index++; - if (playlist->amount > 0 && insert_position <= playlist->first_index && - orig_position != PLAYLIST_PREPEND && playlist->started) + if (orig_position < 0) { - playlist->first_index++; + if (playlist->amount > 0 && insert_position <= playlist->index && + playlist->started) + playlist->index++; + if (playlist->amount > 0 && insert_position <= playlist->first_index && + orig_position != PLAYLIST_PREPEND && playlist->started) + playlist->first_index++; } if (insert_position < playlist->last_insert_pos || -- 2.11.4.GIT