diff options
author | Max Kellermann <max@musicpd.org> | 2018-09-22 19:08:03 +0200 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2018-09-22 19:08:03 +0200 |
commit | 863722545f1d892ce4d30b91f6bf25bb08b48a19 (patch) | |
tree | 7506cbab436c3819172acf5e553e2f1582d1b676 /src/decoder/plugins | |
parent | d3d1d37782952e9b1142a4735635aac3dd2db466 (diff) |
player/CrossFade, ...: use lround()
Diffstat (limited to 'src/decoder/plugins')
-rw-r--r-- | src/decoder/plugins/FaadDecoderPlugin.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/decoder/plugins/FaadDecoderPlugin.cxx b/src/decoder/plugins/FaadDecoderPlugin.cxx index 7fc56b6a0..403feeabc 100644 --- a/src/decoder/plugins/FaadDecoderPlugin.cxx +++ b/src/decoder/plugins/FaadDecoderPlugin.cxx @@ -31,6 +31,7 @@ #include <neaacdec.h> +#include <cmath> #include <exception> #include <assert.h> @@ -386,9 +387,9 @@ faad_stream_decode(DecoderClient &client, InputStream &is, /* update bit rate and position */ if (frame_info.samples > 0) { - bit_rate = frame_info.bytesconsumed * 8.0 * - frame_info.channels * audio_format.sample_rate / - frame_info.samples / 1000 + 0.5; + bit_rate = lround(frame_info.bytesconsumed * 8.0 * + frame_info.channels * audio_format.sample_rate / + frame_info.samples / 1000); } /* send PCM samples to MPD */ |