mirror of
				https://github.com/alsa-project/alsa-lib.git
				synced 2025-11-03 09:01:52 -05:00 
			
		
		
		
	pcm: file: update linked hw_ptr and appl_ptr
Plugin file provides no private hw_ptr and appl_ptr but instead links them to the slave pcm. If the slave pcm itself changes its hw_ptr or app_prt this needs to be done in file plugin, too. Plugin 'plug' is such a candidate changing the hw_ptr and app_ptr in hw_params call dependent on the automatically inserted plugins. ALSA unfortunately has no support for automatically updating chained pointers. A notification on pointer change seems to be prepared inside the snd_pcm_set_ptr() routine via rbptr->changed(), but it is not (yet) implemented so that we need to care for it manually. Signed-off-by: Andreas Pape <apape@de.adit-jv.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
		
							parent
							
								
									e1e211208a
								
							
						
					
					
						commit
						ada1eb4139
					
				
					 1 changed files with 8 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -642,6 +642,14 @@ static int snd_pcm_file_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t * params)
 | 
			
		|||
			return err;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/* pointer may have changed - e.g if plug is used. */
 | 
			
		||||
	snd_pcm_unlink_hw_ptr(pcm, file->gen.slave);
 | 
			
		||||
	snd_pcm_unlink_appl_ptr(pcm, file->gen.slave);
 | 
			
		||||
 | 
			
		||||
	snd_pcm_link_hw_ptr(pcm, file->gen.slave);
 | 
			
		||||
	snd_pcm_link_appl_ptr(pcm, file->gen.slave);
 | 
			
		||||
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue