module-combine-sink: Use fabs() instead of abs() for double

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/733>
This commit is contained in:
Peter Meerwald-Stadler 2022-06-14 00:15:34 +02:00 committed by PulseAudio Marge Bot
parent 07a9fcefba
commit 0b4af61ee7

View file

@ -23,6 +23,7 @@
#include <stdio.h>
#include <errno.h>
#include <math.h>
#include <pulse/rtclock.h>
#include <pulse/timeval.h>
@ -239,7 +240,7 @@ static uint32_t rate_controller(
/* Choose the rate that is nearer to base_rate */
new_rate = new_rate_2;
if (abs(new_rate_1 - base_rate) < abs(new_rate_2 - base_rate))
if (fabs(new_rate_1 - base_rate) < fabs(new_rate_2 - base_rate))
new_rate = new_rate_1;
return (uint32_t)(new_rate + 0.5);