Bug 1314316 - Restore use of ceilf method instead of roundf. r?jesup
MozReview-Commit-ID: 5Wv5dqSy3B8
--- a/media/libcubeb/README_MOZILLA
+++ b/media/libcubeb/README_MOZILLA
@@ -1,8 +1,8 @@
The source from this directory was copied from the cubeb
git repository using the update.sh script. The only changes
made were those applied by update.sh and the addition of
Makefile.in build files for the Mozilla build system.
The cubeb git repository is: git://github.com/kinetiknz/cubeb.git
-The git commit ID used was 9eacd3144b62ce2356c66c3260c9bc4151274192.
+The git commit ID used was 352c0bed012a770ef65aee1e507704922ea80b0e.
--- a/media/libcubeb/src/cubeb_resampler_internal.h
+++ b/media/libcubeb/src/cubeb_resampler_internal.h
@@ -258,18 +258,18 @@ public:
}
/** Returns the number of frames to pass in the input of the resampler to have
* exactly `output_frame_count` resampled frames. This can return a number
* slightly bigger than what is strictly necessary, but it guaranteed that the
* number of output frames will be exactly equal. */
uint32_t input_needed_for_output(uint32_t output_frame_count)
{
- return (uint32_t)roundf((output_frame_count - samples_to_frames(resampling_out_buffer.length()))
- * resampling_ratio);
+ return (uint32_t)ceilf((output_frame_count - samples_to_frames(resampling_out_buffer.length()))
+ * resampling_ratio);
}
/** Returns a pointer to the input buffer, that contains empty space for at
* least `frame_count` elements. This is useful so that consumer can directly
* write into the input buffer of the resampler. The pointer returned is
* adjusted so that leftover data are not overwritten.
*/