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
This commit is contained in:
Magnus Holmgren 2006-04-30 08:39:24 +00:00
parent 3bd4b0be39
commit e187e01e36

View file

@ -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);