[clang-tidy] fix incorrect rounding
Found with bugprone-incorrect-roundings Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
parent
177371a003
commit
5e4b7e2fb7
@ -25,6 +25,7 @@
|
|||||||
#include "tag/Handler.hxx"
|
#include "tag/Handler.hxx"
|
||||||
#include "fs/Path.hxx"
|
#include "fs/Path.hxx"
|
||||||
#include "util/Alloc.hxx"
|
#include "util/Alloc.hxx"
|
||||||
|
#include "util/Math.hxx"
|
||||||
#include "util/ScopeExit.hxx"
|
#include "util/ScopeExit.hxx"
|
||||||
#include "util/RuntimeError.hxx"
|
#include "util/RuntimeError.hxx"
|
||||||
|
|
||||||
@ -263,8 +264,7 @@ wavpack_decode(DecoderClient &client, WavpackContext *wpc, bool can_seek)
|
|||||||
if (samples_got == 0)
|
if (samples_got == 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
int bitrate = (int)(WavpackGetInstantBitrate(wpc) / 1000 +
|
int bitrate = lround(WavpackGetInstantBitrate(wpc) / 1000);
|
||||||
0.5);
|
|
||||||
format_samples(chunk, samples_got * audio_format.channels);
|
format_samples(chunk, samples_got * audio_format.channels);
|
||||||
|
|
||||||
cmd = client.SubmitData(nullptr, chunk,
|
cmd = client.SubmitData(nullptr, chunk,
|
||||||
|
Loading…
Reference in New Issue
Block a user