From e187e01e36e9366846e5c3ec2029cd03159fff35 Mon Sep 17 00:00:00 2001 From: Magnus Holmgren Date: Sun, 30 Apr 2006 08:39:24 +0000 Subject: Fix one seeking bug: when seeking back to before a resume point, audio from another track could be played. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9837 a1c6a512-1295-4272-9138-f99709370657 --- apps/playback.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'apps') diff --git a/apps/playback.c b/apps/playback.c index c6f30865a5..a2f1672ea1 100644 --- a/apps/playback.c +++ b/apps/playback.c @@ -1904,16 +1904,20 @@ static void generate_postbuffer_events(void) static void initialize_buffer_fill(bool clear_tracks) { - fill_bytesleft = filebuflen - filebufused; - if (buf_ridx > cur_ti->buf_idx) - cur_ti->start_pos = buf_ridx - cur_ti->buf_idx; - /* Don't initialize if we're already initialized */ if (filling) return ; logf("Starting buffer fill"); + fill_bytesleft = filebuflen - filebufused; + /* TODO: This doesn't look right, and might explain some problems with + * seeking in large files (to offsets larger than filebuflen). + * And what about buffer wraps? + */ + if (buf_ridx > cur_ti->buf_idx) + cur_ti->start_pos = buf_ridx - cur_ti->buf_idx; + if (clear_tracks) audio_clear_track_entries(true, false); -- cgit v1.2.3