diff options
author | Andree Buschmann <AndreeBuschmann@t-online.de> | 2011-04-07 20:33:00 +0000 |
---|---|---|
committer | Andree Buschmann <AndreeBuschmann@t-online.de> | 2011-04-07 20:33:00 +0000 |
commit | 4df825be4325919a843cdb1181bc435645212a51 (patch) | |
tree | b182fd1f5a5fbbc0fa0c8867e6974e7e5cc1dc22 /apps/playlist.c | |
parent | 37990206dd28c10ab0470e4d7171ca993013a93c (diff) | |
download | rockbox-4df825be4325919a843cdb1181bc435645212a51.tar.gz 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.c | 18 |
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, | |||
819 | 819 | ||
820 | playlist->amount++; | 820 | playlist->amount++; |
821 | playlist->num_inserted_tracks++; | 821 | playlist->num_inserted_tracks++; |
822 | |||
823 | /* Update index for resume. */ | ||
824 | playback_set_playlist_index(playlist->index); | ||
822 | 825 | ||
823 | return insert_position; | 826 | return insert_position; |
824 | } | 827 | } |
@@ -919,6 +922,9 @@ static int remove_track_from_playlist(struct playlist_info* playlist, | |||
919 | 922 | ||
920 | sync_control(playlist, false); | 923 | sync_control(playlist, false); |
921 | } | 924 | } |
925 | |||
926 | /* Update index for resume. */ | ||
927 | playback_set_playlist_index(playlist->index); | ||
922 | 928 | ||
923 | return 0; | 929 | return 0; |
924 | } | 930 | } |
@@ -978,6 +984,9 @@ static int randomise_playlist(struct playlist_info* playlist, | |||
978 | update_control(playlist, PLAYLIST_COMMAND_SHUFFLE, seed, | 984 | update_control(playlist, PLAYLIST_COMMAND_SHUFFLE, seed, |
979 | playlist->first_index, NULL, NULL, NULL); | 985 | playlist->first_index, NULL, NULL, NULL); |
980 | } | 986 | } |
987 | |||
988 | /* Update index for resume. */ | ||
989 | playback_set_playlist_index(playlist->index); | ||
981 | 990 | ||
982 | return 0; | 991 | return 0; |
983 | } | 992 | } |
@@ -1018,6 +1027,9 @@ static int sort_playlist(struct playlist_info* playlist, bool start_current, | |||
1018 | update_control(playlist, PLAYLIST_COMMAND_UNSHUFFLE, | 1027 | update_control(playlist, PLAYLIST_COMMAND_UNSHUFFLE, |
1019 | playlist->first_index, -1, NULL, NULL, NULL); | 1028 | playlist->first_index, -1, NULL, NULL, NULL); |
1020 | } | 1029 | } |
1030 | |||
1031 | /* Update index for resume. */ | ||
1032 | playback_set_playlist_index(playlist->index); | ||
1021 | 1033 | ||
1022 | return 0; | 1034 | return 0; |
1023 | } | 1035 | } |
@@ -1191,6 +1203,9 @@ static void find_and_set_playlist_index(struct playlist_info* playlist, | |||
1191 | break; | 1203 | break; |
1192 | } | 1204 | } |
1193 | } | 1205 | } |
1206 | |||
1207 | /* Update index for resume. */ | ||
1208 | playback_set_playlist_index(playlist->index); | ||
1194 | } | 1209 | } |
1195 | 1210 | ||
1196 | /* | 1211 | /* |
@@ -3174,6 +3189,9 @@ int playlist_move(struct playlist_info* playlist, int index, int new_index) | |||
3174 | queue_post(&playlist_queue, PLAYLIST_LOAD_POINTERS, 0); | 3189 | queue_post(&playlist_queue, PLAYLIST_LOAD_POINTERS, 0); |
3175 | #endif | 3190 | #endif |
3176 | 3191 | ||
3192 | /* Update index for resume. */ | ||
3193 | playback_set_playlist_index(playlist->index); | ||
3194 | |||
3177 | return result; | 3195 | return result; |
3178 | } | 3196 | } |
3179 | 3197 | ||