mirror of
				https://github.com/alsa-project/alsa-lib.git
				synced 2025-11-03 09:01:52 -05:00 
			
		
		
		
	pcm: rate: fix hw_ptr exceed the boundary
For long time test case, the hw_ptr will exceed the boundary, then cause the avail size wrong. Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
		
							parent
							
								
									ea865bba46
								
							
						
					
					
						commit
						035f196bcd
					
				
					 1 changed files with 2 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -574,6 +574,8 @@ static inline void snd_pcm_rate_sync_hwptr(snd_pcm_t *pcm)
 | 
			
		|||
	rate->hw_ptr =
 | 
			
		||||
		(slave_hw_ptr / rate->gen.slave->period_size) * pcm->period_size +
 | 
			
		||||
		rate->ops.input_frames(rate->obj, slave_hw_ptr % rate->gen.slave->period_size);
 | 
			
		||||
 | 
			
		||||
	rate->hw_ptr %= pcm->boundary;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int snd_pcm_rate_hwsync(snd_pcm_t *pcm)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue