aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-12-26 00:35:05 +0100
committerMax Kellermann <max@duempel.org>2009-12-26 02:58:30 +0100
commit8a6d448aaf2095a691982eb7c2942dbad125a755 (patch)
tree42096823ff50002bb94601c26b557a4f250333fd /src/decoder
parenta1939f396618cd7c68d66bc388f051f137c163c6 (diff)
downloadmpd-8a6d448aaf2095a691982eb7c2942dbad125a755.tar.gz
mpd-8a6d448aaf2095a691982eb7c2942dbad125a755.tar.xz
mpd-8a6d448aaf2095a691982eb7c2942dbad125a755.zip
decoder/wavpack: allow fine-grained seeking
First multiply the floating point return value of decoder_seek_where(), then cast to integer.
Diffstat (limited to 'src/decoder')
-rw-r--r--src/decoder/wavpack_plugin.c5
1 files changed, 2 insertions, 3 deletions
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);