From 863722545f1d892ce4d30b91f6bf25bb08b48a19 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 22 Sep 2018 19:08:03 +0200 Subject: player/CrossFade, ...: use lround() --- src/decoder/plugins/FaadDecoderPlugin.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/decoder/plugins') 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 +#include #include #include @@ -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 */ -- cgit v1.2.3