summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
authorHardeep Sidhu <dyp@pobox.com>2005-07-04 22:50:57 +0000
committerHardeep Sidhu <dyp@pobox.com>2005-07-04 22:50:57 +0000
commit839dbcaed7ea135dcc0812de76f9ff5c1dc924f5 (patch)
tree2a9ea28b5da29ff2749f0b4bb3be059eafc98fa4 /firmware
parent3fd775b7d15c9c5133c68ba45caf8bfc78cadfa1 (diff)
downloadrockbox-839dbcaed7ea135dcc0812de76f9ff5c1dc924f5.zip
rockbox-839dbcaed7ea135dcc0812de76f9ff5c1dc924f5.tar.gz
rockbox-839dbcaed7ea135dcc0812de76f9ff5c1dc924f5.tar.bz2
rockbox-839dbcaed7ea135dcc0812de76f9ff5c1dc924f5.tar.xz
Moved resume info updating to the mpeg/playback threads so that it's saved even when not in the WPS
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7018 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/mpeg.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/firmware/mpeg.c b/firmware/mpeg.c
index 9e61e02..db8994c 100644
--- a/firmware/mpeg.c
+++ b/firmware/mpeg.c
@@ -92,7 +92,7 @@ extern char* playlist_peek(int steps);
extern bool playlist_check(int steps);
extern int playlist_next(int steps);
extern int playlist_amount(void);
-extern void update_file_pos( int id, int pos );
+extern int playlist_update_resume_info(const struct mp3entry* id3);
/* list of tracks in memory */
#define MAX_TRACK_ENTRIES (1<<4) /* Must be power of 2 */
@@ -872,6 +872,8 @@ static void update_playlist(void)
if (playlist_next(playlist_amount()) < 0)
is_playing = false;
}
+
+ playlist_update_resume_info(audio_current_track());
}
static void track_change(void)
@@ -1036,6 +1038,11 @@ static void mpeg_thread(void)
{
queue_wait_w_tmo(&mpeg_queue, &ev, 0);
}
+ else if (playing)
+ {
+ /* periodically update resume info */
+ queue_wait_w_tmo(&mpeg_queue, &ev, HZ/2);
+ }
else
{
DEBUGF("S R:%x W:%x SW:%x\n",
@@ -1108,6 +1115,10 @@ static void mpeg_thread(void)
DEBUGF("MPEG_STOP\n");
is_playing = false;
paused = false;
+
+ if (playing)
+ playlist_update_resume_info(audio_current_track());
+
stop_playing();
mpeg_stop_done = true;
break;
@@ -1120,6 +1131,7 @@ static void mpeg_thread(void)
pause_tick = current_tick;
pause_track = current_track_counter;
mp3_play_pause(false);
+ playlist_update_resume_info(audio_current_track());
break;
case MPEG_RESUME:
@@ -1564,6 +1576,11 @@ static void mpeg_thread(void)
init_recording_done = true;
break;
#endif /* #if CONFIG_HWCODEC == MAS3587F */
+
+ case SYS_TIMEOUT:
+ if (playing)
+ playlist_update_resume_info(audio_current_track());
+ break;
}
#if CONFIG_HWCODEC == MAS3587F
}