forked from len0rd/rockbox
fix bug: WAV file playback does not resume (FS#11077)
Not only WAV but also Sun audio, SMAF, vox and WAV64 can resume. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25289 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
20fccd8489
commit
7a3822c8b0
17 changed files with 188 additions and 69 deletions
|
@ -59,12 +59,14 @@ static bool set_format(struct pcm_format *format)
|
|||
return true;
|
||||
}
|
||||
|
||||
static struct pcm_pos *get_seek_pos(long seek_time,
|
||||
static struct pcm_pos *get_seek_pos(uint32_t seek_val, int seek_mode,
|
||||
uint8_t *(*read_buffer)(size_t *realsize))
|
||||
{
|
||||
static struct pcm_pos newpos;
|
||||
uint32_t newblock = ((uint64_t)seek_time * ci->id3->frequency)
|
||||
/ (1000LL * fmt->samplesperblock);
|
||||
uint32_t newblock = (seek_mode == PCM_SEEK_TIME) ?
|
||||
((uint64_t)seek_val * ci->id3->frequency / 1000LL)
|
||||
/ fmt->samplesperblock :
|
||||
seek_val / fmt->blockalign;
|
||||
|
||||
(void)read_buffer;
|
||||
newpos.pos = newblock * fmt->blockalign;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue