From 77bc4543d84686e768522ab803e03a99cc104326 Mon Sep 17 00:00:00 2001 From: rehans Date: Tue, 5 Sep 2017 16:12:58 +0200 Subject: [PATCH] Round floats by using roundf in order to round correctly. --- RtAudio.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RtAudio.cpp b/RtAudio.cpp index f72c899..b29cae9 100644 --- a/RtAudio.cpp +++ b/RtAudio.cpp @@ -4974,7 +4974,7 @@ void RtApiWasapi::wasapiThread() } if ( stream_.mode == INPUT ) { - convBuffSize = ( size_t ) ( stream_.bufferSize * captureSrRatio ) * stream_.nDeviceChannels[INPUT] * formatBytes( stream_.deviceFormat[INPUT] ); + convBuffSize = ( size_t ) std::roundf( stream_.bufferSize * captureSrRatio ) * stream_.nDeviceChannels[INPUT] * formatBytes( stream_.deviceFormat[INPUT] ); deviceBuffSize = stream_.bufferSize * stream_.nDeviceChannels[INPUT] * formatBytes( stream_.deviceFormat[INPUT] ); } else if ( stream_.mode == OUTPUT ) { -- 2.30.2