diff options
author | Yoshihisa Uchida <uchida@rockbox.org> | 2010-03-22 10:02:05 +0000 |
---|---|---|
committer | Yoshihisa Uchida <uchida@rockbox.org> | 2010-03-22 10:02:05 +0000 |
commit | 7a3822c8b03a5438a1bcfd6e38c0e6860dda3348 (patch) | |
tree | e50740c7f0ccd6aff1aac0e292a000ac7ef6be14 /apps/codecs/libpcm/linear_pcm.c | |
parent | 20fccd84897352478c3306e41ca0fab0a5f4c65e (diff) | |
download | rockbox-7a3822c8b03a5438a1bcfd6e38c0e6860dda3348.tar.gz rockbox-7a3822c8b03a5438a1bcfd6e38c0e6860dda3348.zip |
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
Diffstat (limited to 'apps/codecs/libpcm/linear_pcm.c')
-rw-r--r-- | apps/codecs/libpcm/linear_pcm.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/apps/codecs/libpcm/linear_pcm.c b/apps/codecs/libpcm/linear_pcm.c index e58856efe8..5c3c140b8c 100644 --- a/apps/codecs/libpcm/linear_pcm.c +++ b/apps/codecs/libpcm/linear_pcm.c | |||
@@ -71,12 +71,14 @@ static bool set_format(struct pcm_format *format) | |||
71 | return true; | 71 | return true; |
72 | } | 72 | } |
73 | 73 | ||
74 | static struct pcm_pos *get_seek_pos(long seek_time, | 74 | static struct pcm_pos *get_seek_pos(uint32_t seek_val, int seek_mode, |
75 | uint8_t *(*read_buffer)(size_t *realsize)) | 75 | uint8_t *(*read_buffer)(size_t *realsize)) |
76 | { | 76 | { |
77 | static struct pcm_pos newpos; | 77 | static struct pcm_pos newpos; |
78 | uint32_t newblock = ((uint64_t)seek_time * ci->id3->frequency) | 78 | uint32_t newblock = (seek_mode == PCM_SEEK_TIME) ? |
79 | / (1000LL * fmt->samplesperblock); | 79 | ((uint64_t)seek_val * ci->id3->frequency / 1000LL) |
80 | / fmt->samplesperblock : | ||
81 | seek_val / fmt->blockalign; | ||
80 | 82 | ||
81 | (void)read_buffer; | 83 | (void)read_buffer; |
82 | newpos.pos = newblock * fmt->blockalign; | 84 | newpos.pos = newblock * fmt->blockalign; |