diff options
Diffstat (limited to 'apps/codecs/libpcm/yamaha_adpcm.c')
-rw-r--r-- | apps/codecs/libpcm/yamaha_adpcm.c | 11 |
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) return CODEC_OK; } -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 new_count= 0; - - if (seek_time > 0) - new_count = ((uint64_t)seek_time * ci->id3->frequency - / (1000LL * fmt->samplesperblock)) / blocksperchunk; + uint32_t new_count = (seek_mode == PCM_SEEK_TIME)? + ((uint64_t)seek_val * ci->id3->frequency / 1000LL) + / (blocksperchunk * fmt->samplesperblock) : + seek_val / fmt->chunksize; if (!has_block_header) { |