summaryrefslogtreecommitdiffstats
path: root/apps/playlist.c
diff options
context:
space:
mode:
authorAndree Buschmann <AndreeBuschmann@t-online.de>2011-04-06 19:11:40 +0000
committerAndree Buschmann <AndreeBuschmann@t-online.de>2011-04-06 19:11:40 +0000
commit3184cbe10add23e0e4e53523a06e311db0ba15cd (patch)
tree398f34c994e26a3255337b583824952721ab378e /apps/playlist.c
parentc7227a76206960f8373def21aea71cd1b7e9e5c4 (diff)
downloadrockbox-3184cbe10add23e0e4e53523a06e311db0ba15cd.tar.gz
rockbox-3184cbe10add23e0e4e53523a06e311db0ba15cd.tar.bz2
rockbox-3184cbe10add23e0e4e53523a06e311db0ba15cd.zip
Fix FS#12043. Next track was resumed when pausing and shutting down the player in the last seconds of a track.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29682 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/playlist.c')
-rw-r--r--apps/playlist.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/apps/playlist.c b/apps/playlist.c
index bbbbe22349..f65be48069 100644
--- a/apps/playlist.c
+++ b/apps/playlist.c
@@ -2612,24 +2612,28 @@ int playlist_get_resume_info(int *resume_index)
return 0;
}
+/* Get current playlist index. */
+int playlist_get_index(void)
+{
+ return current_playlist.index;
+}
+
/* Update resume info for current playing song. Returns -1 on error. */
int playlist_update_resume_info(const struct mp3entry* id3)
{
- struct playlist_info* playlist = &current_playlist;
-
if (id3)
{
- if (global_status.resume_index != playlist->index ||
+ if (global_status.resume_index != id3->index ||
global_status.resume_offset != id3->offset)
{
- global_status.resume_index = playlist->index;
+ global_status.resume_index = id3->index;
global_status.resume_offset = id3->offset;
status_save();
}
}
else
{
- global_status.resume_index = -1;
+ global_status.resume_index = -1;
global_status.resume_offset = -1;
status_save();
}