mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-29 05:40:23 -04:00
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:
parent
07a9fcefba
commit
0b4af61ee7
1 changed files with 2 additions and 1 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue