forked from len0rd/rockbox
Playlists: Fix moving songs in reshuffled playlist
The current index wasn't always correct after moving in a playlist with first index > 0 Change-Id: Ifbcc1e00ed0ec5b26e2176d7971cc5c1e15a8840
This commit is contained in:
parent
e9b4275d1f
commit
d4f1247aec
1 changed files with 5 additions and 0 deletions
|
@ -2749,6 +2749,11 @@ int playlist_move(struct playlist_info* playlist, int index, int new_index)
|
|||
else /* Calculate index of desired position */
|
||||
{
|
||||
new_index = (r+playlist->first_index)%playlist->amount;
|
||||
|
||||
if ((new_index < playlist->first_index) && (new_index <= playlist->index))
|
||||
displace_current = true;
|
||||
else if ((new_index >= playlist->first_index) && (playlist->index < playlist->first_index))
|
||||
displace_current = false;
|
||||
}
|
||||
|
||||
result = add_track_to_playlist_unlocked(playlist, filename,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue