mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	Add pa_sample_rate_valid()
I think this makes the code a bit nicer to read and write. This also reduces the chances of off-by-one errors when checking the bounds of sample rate values.
This commit is contained in:
		
							parent
							
								
									1cda717252
								
							
						
					
					
						commit
						a67318f8af
					
				
					 12 changed files with 24 additions and 21 deletions
				
			
		| 
						 | 
				
			
			@ -4112,7 +4112,7 @@ static void command_update_stream_sample_rate(pa_pdispatch *pd, uint32_t command
 | 
			
		|||
    }
 | 
			
		||||
 | 
			
		||||
    CHECK_VALIDITY(c->pstream, c->authorized, tag, PA_ERR_ACCESS);
 | 
			
		||||
    CHECK_VALIDITY(c->pstream, rate > 0 && rate <= PA_RATE_MAX, tag, PA_ERR_INVALID);
 | 
			
		||||
    CHECK_VALIDITY(c->pstream, pa_sample_rate_valid(rate), tag, PA_ERR_INVALID);
 | 
			
		||||
 | 
			
		||||
    if (command == PA_COMMAND_UPDATE_PLAYBACK_STREAM_SAMPLE_RATE) {
 | 
			
		||||
        playback_stream *s;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue