1
0
Fork 0
forked from len0rd/rockbox

Fix bug 5341: Resume in Wav and Flac doesn't start from the position where it was left off. Mark Arigo helped with the Flac fix.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10051 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Magnus Holmgren 2006-06-04 15:04:03 +00:00
parent 959d23e231
commit f95dd56a2c
3 changed files with 50 additions and 13 deletions

View file

@ -410,11 +410,19 @@ next_track:
}
firstblockposn = 1024 - n;
ci->advance_buffer(firstblockposn);
if (ci->id3->offset > (uint32_t) firstblockposn) {
/* Round down to previous block */
uint32_t offset = ci->id3->offset - ci->id3->offset % blockalign;
ci->advance_buffer(offset);
bytesdone = offset - firstblockposn;
} else {
ci->advance_buffer(firstblockposn);
bytesdone = 0;
}
/* The main decoder loop */
bytesdone = 0;
ci->set_elapsed(0);
endofstream = 0;
/* chunksize is computed so that one chunk is about 1/50s.
* this make 4096 for 44.1kHz 16bits stereo.