From: Andrew Eikum Subject: Re: [PATCH] winepulse.drv: Avoid unnecessary use of ceil function Message-Id: <20181205133445.3ftfo7bt2es3l7w2@foghorn.codeweavers.com> Date: Wed, 5 Dec 2018 07:34:46 -0600 In-Reply-To: <20181202230934.12751-1-alexhenrie24@gmail.com> References: <20181202230934.12751-1-alexhenrie24@gmail.com> I guess I'm not opposed to this, but my feeling is "if it's not broken, don't fix it". Maybe there's something I don't know. Can you explain what advantage this has? Thanks, Andrew On Sun, Dec 02, 2018 at 04:09:34PM -0700, Alex Henrie wrote: > Signed-off-by: Alex Henrie > --- > dlls/winepulse.drv/mmdevdrv.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c > index 8d57f1a45a..0823af6341 100644 > --- a/dlls/winepulse.drv/mmdevdrv.c > +++ b/dlls/winepulse.drv/mmdevdrv.c > @@ -28,7 +28,6 @@ > > #include > #include > -#include > #include > #include > > @@ -1400,7 +1399,7 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient *iface, > period_bytes = pa_frame_size(&This->ss) * MulDiv(period, This->ss.rate, 10000000); > > if (duration < 20000000) > - This->bufsize_frames = ceil((duration / 10000000.) * fmt->nSamplesPerSec); > + This->bufsize_frames = (duration * fmt->nSamplesPerSec + 9999999) / 10000000; > else > This->bufsize_frames = 2 * fmt->nSamplesPerSec; > This->bufsize_bytes = This->bufsize_frames * pa_frame_size(&This->ss); > -- > 2.19.2 >