Round floats by using roundf in order to round correctly. 96/head
authorrehans <rene@hansen-audio.de>
Tue, 5 Sep 2017 14:12:58 +0000 (16:12 +0200)
committerrehans <rene@hansen-audio.de>
Tue, 5 Sep 2017 14:12:58 +0000 (16:12 +0200)
RtAudio.cpp

index f72c899835b4283403d02bfaae12e31e057a2bc1..b29cae97ba3125ea11643bbd3ea8c433d4941082 100644 (file)
@@ -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 ) {