summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrandon Low <lostlogic@rockbox.org>2006-04-23 23:27:11 +0000
committerBrandon Low <lostlogic@rockbox.org>2006-04-23 23:27:11 +0000
commitd461a3ef65000ce73b940a9660cb78ae3deea21c (patch)
tree5de055c8ce4e2911ce0fcff4f6c98f1738342e72
parent6c0908b4160838142225c5b570036c4d98de4ece (diff)
downloadrockbox-d461a3ef65000ce73b940a9660cb78ae3deea21c.tar.gz
rockbox-d461a3ef65000ce73b940a9660cb78ae3deea21c.tar.bz2
rockbox-d461a3ef65000ce73b940a9660cb78ae3deea21c.zip
Fix some todos, and prevent the position from jumping around badly on seek
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9781 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/playback.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/apps/playback.c b/apps/playback.c
index 1ea1c6759c..d03e16d42f 100644
--- a/apps/playback.c
+++ b/apps/playback.c
@@ -17,10 +17,9 @@
*
****************************************************************************/
-/* TODO: Fast codecs seem to cause badness on track skipping (stop, old audio,
- * then new audio). Investigate the CFL_FLUSH mode used for all track skips */
/* TODO: Check for a possibly broken codepath on a rapid skip, stop event */
/* TODO: same in reverse ^^ */
+/* TODO: Also play, stop ^^ */
/* TODO: Can use the track changed callback to detect end of track and seek
* in the previous track until this happens */
/* Design: we have prev_ti already, have a conditional for what type of seek
@@ -488,12 +487,14 @@ static void voice_set_elapsed_callback(unsigned int value)
static void codec_set_elapsed_callback(unsigned int value)
{
unsigned int latency;
+ if (ci.seek_time)
+ return;
#ifdef AB_REPEAT_ENABLE
ab_position_report(value);
#endif
- latency = pcmbuf_get_latency();
+ latency = pcmbuf_get_latency();
if (value < latency)
cur_ti->id3.elapsed = 0;
else if (value - latency > cur_ti->id3.elapsed ||
@@ -508,7 +509,11 @@ static void voice_set_offset_callback(size_t value)
static void codec_set_offset_callback(size_t value)
{
- unsigned int latency = pcmbuf_get_latency() * cur_ti->id3.bitrate / 8;
+ unsigned int latency;
+ if (ci.seek_time)
+ return;
+
+ latency = pcmbuf_get_latency() * cur_ti->id3.bitrate / 8;
if (value < latency)
cur_ti->id3.offset = 0;
else
@@ -859,7 +864,6 @@ static void audio_update_trackinfo(void)
cur_ti->id3.offset = 0;
ci.id3 = &cur_ti->id3;
ci.curpos = 0;
- ci.seek_time = 0;
ci.taginfo_ready = &cur_ti->taginfo_ready;
}