summaryrefslogtreecommitdiff
path: root/apps/codecs/libpcm/yamaha_adpcm.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/codecs/libpcm/yamaha_adpcm.c')
-rw-r--r--apps/codecs/libpcm/yamaha_adpcm.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/apps/codecs/libpcm/yamaha_adpcm.c b/apps/codecs/libpcm/yamaha_adpcm.c
index 0b997ad776..f1fb9b68ae 100644
--- a/apps/codecs/libpcm/yamaha_adpcm.c
+++ b/apps/codecs/libpcm/yamaha_adpcm.c
@@ -214,15 +214,14 @@ static int decode_for_seek(const uint8_t *inbuf, size_t inbufsize)
214 return CODEC_OK; 214 return CODEC_OK;
215} 215}
216 216
217static struct pcm_pos *get_seek_pos(long seek_time, 217static struct pcm_pos *get_seek_pos(uint32_t seek_val, int seek_mode,
218 uint8_t *(*read_buffer)(size_t *realsize)) 218 uint8_t *(*read_buffer)(size_t *realsize))
219{ 219{
220 static struct pcm_pos newpos; 220 static struct pcm_pos newpos;
221 uint32_t new_count= 0; 221 uint32_t new_count = (seek_mode == PCM_SEEK_TIME)?
222 222 ((uint64_t)seek_val * ci->id3->frequency / 1000LL)
223 if (seek_time > 0) 223 / (blocksperchunk * fmt->samplesperblock) :
224 new_count = ((uint64_t)seek_time * ci->id3->frequency 224 seek_val / fmt->chunksize;
225 / (1000LL * fmt->samplesperblock)) / blocksperchunk;
226 225
227 if (!has_block_header) 226 if (!has_block_header)
228 { 227 {