aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-04-08 23:45:21 +0200
committerMax Kellermann <max@duempel.org>2013-04-08 23:45:21 +0200
commitf84e288ad7d89cd58acf3f919d8f2c679811dfcf (patch)
treef6b179d1fd53cfb79d514cd6dc4ae42b2f9d1a8e /src
parent8e31366431858782de117dfb6146fd5ebf788ce0 (diff)
downloadmpd-f84e288ad7d89cd58acf3f919d8f2c679811dfcf.tar.gz
mpd-f84e288ad7d89cd58acf3f919d8f2c679811dfcf.tar.xz
mpd-f84e288ad7d89cd58acf3f919d8f2c679811dfcf.zip
decoder/gme: fix rounding error
Cast to integer after multiplying with 1000. Allows sub-second seeking.
Diffstat (limited to '')
-rw-r--r--src/decoder/GmeDecoderPlugin.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/decoder/GmeDecoderPlugin.cxx b/src/decoder/GmeDecoderPlugin.cxx
index 6e59d4c13..b778f68b1 100644
--- a/src/decoder/GmeDecoderPlugin.cxx
+++ b/src/decoder/GmeDecoderPlugin.cxx
@@ -189,7 +189,7 @@ gme_file_decode(struct decoder *decoder, const char *path_fs)
cmd = decoder_data(decoder, nullptr, buf, sizeof(buf), 0);
if (cmd == DECODE_COMMAND_SEEK) {
float where = decoder_seek_where(decoder);
- gme_err = gme_seek(emu, (int)where * 1000);
+ gme_err = gme_seek(emu, int(where * 1000));
if (gme_err != nullptr)
g_warning("%s", gme_err);
decoder_command_finished(decoder);