mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	modules: Make use of new function pa_modargs_get_sample_rate()
by using pa_modargs_get_sample_rate() we avoid inconsistant validity checking of the sample rate in various places Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
This commit is contained in:
		
							parent
							
								
									742b93d32c
								
							
						
					
					
						commit
						e74d4244a2
					
				
					 3 changed files with 3 additions and 6 deletions
				
			
		| 
						 | 
				
			
			@ -2450,8 +2450,7 @@ int pa__init(pa_module *m) {
 | 
			
		|||
        goto fail;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (pa_modargs_get_value_u32(ma, "rate", &u->sample_spec.rate) < 0 ||
 | 
			
		||||
        u->sample_spec.rate <= 0 || u->sample_spec.rate > PA_RATE_MAX) {
 | 
			
		||||
    if (pa_modargs_get_sample_rate(ma, &u->sample_spec.rate) < 0) {
 | 
			
		||||
        pa_log_error("Failed to get rate from module arguments");
 | 
			
		||||
        goto fail;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue