From 8a6d448aaf2095a691982eb7c2942dbad125a755 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 26 Dec 2009 00:35:05 +0100 Subject: [PATCH] decoder/wavpack: allow fine-grained seeking First multiply the floating point return value of decoder_seek_where(), then cast to integer. --- NEWS | 1 + src/decoder/wavpack_plugin.c | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index cd39e9066..24ded72e2 100644 --- a/NEWS +++ b/NEWS @@ -9,6 +9,7 @@ ver 0.15.7 (2009/??/??) - id3: fix ID3v1 charset conversion * decoders: - ffmpeg: don't try to force stereo + - wavpack: allow fine-grained seeking * mixer: explicitly close all mixers on shutdown * mapper: fix memory leak when playlist_directory is not set * mapper: apply filesystem_charset to playlists diff --git a/src/decoder/wavpack_plugin.c b/src/decoder/wavpack_plugin.c index 645c8962e..7ad3a62b0 100644 --- a/src/decoder/wavpack_plugin.c +++ b/src/decoder/wavpack_plugin.c @@ -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);