decoder/wavpack: allow fine-grained seeking

First multiply the floating point return value of
decoder_seek_where(), then cast to integer.
This commit is contained in:
Max Kellermann
2009-12-26 00:35:05 +01:00
parent a1939f3966
commit 8a6d448aaf
2 changed files with 3 additions and 3 deletions

View File

@@ -185,10 +185,9 @@ wavpack_decode(struct decoder *decoder, WavpackContext *wpc, bool can_seek,
do {
if (decoder_get_command(decoder) == DECODE_COMMAND_SEEK) {
if (can_seek) {
int where;
unsigned where = decoder_seek_where(decoder) *
audio_format.sample_rate;
where = decoder_seek_where(decoder);
where *= audio_format.sample_rate;
if (WavpackSeekSample(wpc, where)) {
position = where;
decoder_command_finished(decoder);