From f14f01de7c3cf6806af9ec0daa98384c03d77fb1 Mon Sep 17 00:00:00 2001 From: Paul Adenot Date: Thu, 19 Feb 2015 19:35:06 +1300 Subject: [PATCH] Bug 1132034 - Properly round the number of frame for the accumulating clock in WASAPI. r=kinetik --- media/libcubeb/src/cubeb_wasapi.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/media/libcubeb/src/cubeb_wasapi.cpp b/media/libcubeb/src/cubeb_wasapi.cpp index 351ee418fb8..d5867c16c0d 100644 --- a/media/libcubeb/src/cubeb_wasapi.cpp +++ b/media/libcubeb/src/cubeb_wasapi.cpp @@ -25,6 +25,7 @@ #include "cubeb/cubeb-stdint.h" #include "cubeb_resampler.h" #include +#include /**Taken from winbase.h, Not in MinGW.*/ #ifndef STACK_SIZE_PARAM_IS_A_RESERVATION @@ -474,7 +475,7 @@ refill(cubeb_stream * stm, float * data, long frames_needed) long out_frames = cubeb_resampler_fill(stm->resampler, dest, frames_needed); - clock_add(stm, frames_needed * stream_to_mix_samplerate_ratio(stm)); + clock_add(stm, roundf(frames_needed * stream_to_mix_samplerate_ratio(stm))); /* XXX: Handle this error. */ if (out_frames < 0) {