mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	sink-input, source-output: Fix mute saving
"i->save_muted = i->save_muted || mute" makes no sense. The intention
was most likely to use "save" instead of "mute" in the assignment.
This line originates from reverting the volume ramping code, commit
8401572fd5.
The idea of "i->save_muted |= save" is that even if the mute state
doesn't change, save_muted should still be updated, but only if the
transition is from "don't save" to "save".
Changing "!i->muted == !mute" to "mute == i->muted" is cosmetic only.
The rationale behind the old form was probably that when we still had
pa_bool_t, booleans could in theory be defined as int, so comparing
the values without the ! operator was not entirely safe. That's
unnecessary now that we use the standard bool type, which can only
have values 0 or 1.
			
			
This commit is contained in:
		
							parent
							
								
									4bd39f9501
								
							
						
					
					
						commit
						cd2db42a6a
					
				
					 2 changed files with 4 additions and 4 deletions
				
			
		| 
						 | 
				
			
			@ -1061,8 +1061,8 @@ void pa_source_output_set_mute(pa_source_output *o, bool mute, bool save) {
 | 
			
		|||
    pa_assert_ctl_context();
 | 
			
		||||
    pa_assert(PA_SOURCE_OUTPUT_IS_LINKED(o->state));
 | 
			
		||||
 | 
			
		||||
    if (!o->muted == !mute) {
 | 
			
		||||
        o->save_muted = o->save_muted || mute;
 | 
			
		||||
    if (mute == o->muted) {
 | 
			
		||||
        o->save_muted |= save;
 | 
			
		||||
        return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue