mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05: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 <stdio.h>
 | 
				
			||||||
#include <errno.h>
 | 
					#include <errno.h>
 | 
				
			||||||
 | 
					#include <math.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <pulse/rtclock.h>
 | 
					#include <pulse/rtclock.h>
 | 
				
			||||||
#include <pulse/timeval.h>
 | 
					#include <pulse/timeval.h>
 | 
				
			||||||
| 
						 | 
					@ -239,7 +240,7 @@ static uint32_t rate_controller(
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /* Choose the rate that is nearer to base_rate */
 | 
					    /* Choose the rate that is nearer to base_rate */
 | 
				
			||||||
    new_rate = new_rate_2;
 | 
					    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;
 | 
					        new_rate = new_rate_1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return (uint32_t)(new_rate + 0.5);
 | 
					    return (uint32_t)(new_rate + 0.5);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue