mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	alsa: CLAMP the error just in case something goes wrong.
The calculation of the elapsed time is actually not a good idea because it becomes larger and larger and a tiny change in the rate could result in a large difference that would make things fail quickly. Until that is fixed, this patch will need to do..
This commit is contained in:
		
							parent
							
								
									5fa1ae99ae
								
							
						
					
					
						commit
						c2c7dd040a
					
				
					 1 changed files with 1 additions and 0 deletions
				
			
		| 
						 | 
					@ -732,6 +732,7 @@ static int update_time(struct seq_state *state, uint64_t nsec, bool follower)
 | 
				
			||||||
	queue_elapsed = NSEC_TO_CLOCK(state->clock, state->queue_time) / corr;
 | 
						queue_elapsed = NSEC_TO_CLOCK(state->clock, state->queue_time) / corr;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	err = ((int64_t)clock_elapsed - (int64_t) queue_elapsed);
 | 
						err = ((int64_t)clock_elapsed - (int64_t) queue_elapsed);
 | 
				
			||||||
 | 
						err = SPA_CLAMP(err, -64, 64);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (state->dll.bw == 0.0) {
 | 
						if (state->dll.bw == 0.0) {
 | 
				
			||||||
		spa_dll_set_bw(&state->dll, SPA_DLL_BW_MAX, state->threshold,
 | 
							spa_dll_set_bw(&state->dll, SPA_DLL_BW_MAX, state->threshold,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue