diff options
Diffstat (limited to 'apps/codecs/libpcm/itut_g711.c')
-rw-r--r-- | apps/codecs/libpcm/itut_g711.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/apps/codecs/libpcm/itut_g711.c b/apps/codecs/libpcm/itut_g711.c index 097dd5cc25..88ff5f59e6 100644 --- a/apps/codecs/libpcm/itut_g711.c +++ b/apps/codecs/libpcm/itut_g711.c | |||
@@ -139,12 +139,14 @@ static bool set_format(struct pcm_format *format) | |||
139 | return true; | 139 | return true; |
140 | } | 140 | } |
141 | 141 | ||
142 | static struct pcm_pos *get_seek_pos(long seek_time, | 142 | static struct pcm_pos *get_seek_pos(uint32_t seek_val, int seek_mode, |
143 | uint8_t *(*read_buffer)(size_t *realsize)) | 143 | uint8_t *(*read_buffer)(size_t *realsize)) |
144 | { | 144 | { |
145 | static struct pcm_pos newpos; | 145 | static struct pcm_pos newpos; |
146 | uint32_t newblock = ((uint64_t)seek_time * ci->id3->frequency) | 146 | uint32_t newblock = (seek_mode == PCM_SEEK_TIME) ? |
147 | / (1000LL * fmt->samplesperblock); | 147 | ((uint64_t)seek_val * ci->id3->frequency / 1000LL) |
148 | / fmt->samplesperblock : | ||
149 | seek_val / fmt->blockalign; | ||
148 | 150 | ||
149 | (void)read_buffer; | 151 | (void)read_buffer; |
150 | newpos.pos = newblock * fmt->blockalign; | 152 | newpos.pos = newblock * fmt->blockalign; |