Bug 930189 Round up values when getting the minimum latency to avoid values of zero. Patch suggested by jesup. r=padenot
authorMark Banner <bugzilla@standard8.plus.com>
Thu, 24 Oct 2013 14:30:01 +0100
changeset 165780 fc4f336fcedd56349fd747093a89f6129c0fc049
parent 165779 315555d511331bd986b667ab685ef916c243d9af
child 165781 c89628d36c8d75e60bcff9260b969404b9dfae16
push id3066
push userakeybl@mozilla.com
push dateMon, 09 Dec 2013 19:58:46 +0000
treeherdermozilla-beta@a31a0dce83aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspadenot
bugs930189
milestone27.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 930189 Round up values when getting the minimum latency to avoid values of zero. Patch suggested by jesup. r=padenot
media/libcubeb/src/cubeb_audiounit.c
--- a/media/libcubeb/src/cubeb_audiounit.c
+++ b/media/libcubeb/src/cubeb_audiounit.c
@@ -230,17 +230,17 @@ static int
 audiounit_get_min_latency(cubeb * ctx, cubeb_stream_params params, uint32_t * latency_ms)
 {
   AudioValueRange latency_range;
 
   if (audiounit_get_acceptable_latency_range(&latency_range) != CUBEB_OK) {
     return CUBEB_ERROR;
   }
 
-  *latency_ms = latency_range.mMinimum * 1000 / params.rate;
+  *latency_ms = (latency_range.mMinimum * 1000 + params.rate - 1) / params.rate;
 
   return CUBEB_OK;
 }
 
 static int
 audiounit_get_preferred_sample_rate(cubeb * ctx, uint32_t * rate)
 {
   UInt32 size;