summaryrefslogtreecommitdiffstats
path: root/apps/playlist.c
diff options
context:
space:
mode:
authorAndree Buschmann <AndreeBuschmann@t-online.de>2011-04-07 20:33:00 +0000
committerAndree Buschmann <AndreeBuschmann@t-online.de>2011-04-07 20:33:00 +0000
commit4df825be4325919a843cdb1181bc435645212a51 (patch)
treeb182fd1f5a5fbbc0fa0c8867e6974e7e5cc1dc22 /apps/playlist.c
parent37990206dd28c10ab0470e4d7171ca993013a93c (diff)
downloadrockbox-4df825be4325919a843cdb1181bc435645212a51.tar.gz
rockbox-4df825be4325919a843cdb1181bc435645212a51.tar.bz2
rockbox-4df825be4325919a843cdb1181bc435645212a51.zip
Fix regressions of r29682. Update playlist index resume position when playlist changes (e.g. shuffling, inserting, removing, ...).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29690 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/playlist.c')
-rw-r--r--apps/playlist.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/apps/playlist.c b/apps/playlist.c
index f65be48069..c15c394b4c 100644
--- a/apps/playlist.c
+++ b/apps/playlist.c
@@ -819,6 +819,9 @@ static int add_track_to_playlist(struct playlist_info* playlist,
playlist->amount++;
playlist->num_inserted_tracks++;
+
+ /* Update index for resume. */
+ playback_set_playlist_index(playlist->index);
return insert_position;
}
@@ -919,6 +922,9 @@ static int remove_track_from_playlist(struct playlist_info* playlist,
sync_control(playlist, false);
}
+
+ /* Update index for resume. */
+ playback_set_playlist_index(playlist->index);
return 0;
}
@@ -978,6 +984,9 @@ static int randomise_playlist(struct playlist_info* playlist,
update_control(playlist, PLAYLIST_COMMAND_SHUFFLE, seed,
playlist->first_index, NULL, NULL, NULL);
}
+
+ /* Update index for resume. */
+ playback_set_playlist_index(playlist->index);
return 0;
}
@@ -1018,6 +1027,9 @@ static int sort_playlist(struct playlist_info* playlist, bool start_current,
update_control(playlist, PLAYLIST_COMMAND_UNSHUFFLE,
playlist->first_index, -1, NULL, NULL, NULL);
}
+
+ /* Update index for resume. */
+ playback_set_playlist_index(playlist->index);
return 0;
}
@@ -1191,6 +1203,9 @@ static void find_and_set_playlist_index(struct playlist_info* playlist,
break;
}
}
+
+ /* Update index for resume. */
+ playback_set_playlist_index(playlist->index);
}
/*
@@ -3174,6 +3189,9 @@ int playlist_move(struct playlist_info* playlist, int index, int new_index)
queue_post(&playlist_queue, PLAYLIST_LOAD_POINTERS, 0);
#endif
+ /* Update index for resume. */
+ playback_set_playlist_index(playlist->index);
+
return result;
}