mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	If the sink volume is lowered to 0 and then increased again, make sure all stream volumes follow instead of staying at 0
This commit is contained in:
		
							parent
							
								
									2c2713a72c
								
							
						
					
					
						commit
						e356a03ab2
					
				
					 1 changed files with 6 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -1028,6 +1028,8 @@ void pa_sink_update_flat_volume(pa_sink *s, pa_cvolume *new_volume) {
 | 
			
		|||
    for (i = PA_SINK_INPUT(pa_idxset_first(s->inputs, &idx)); i; i = PA_SINK_INPUT(pa_idxset_next(s->inputs, &idx))) {
 | 
			
		||||
        pa_cvolume remapped_new_volume;
 | 
			
		||||
 | 
			
		||||
        /* This basically calculates i->soft_volume := i->virtual_volume / new_volume * i->volume_factor */
 | 
			
		||||
 | 
			
		||||
        remapped_new_volume = *new_volume;
 | 
			
		||||
        pa_cvolume_remap(&remapped_new_volume, &s->channel_map, &i->channel_map);
 | 
			
		||||
        pa_sw_cvolume_divide(&i->soft_volume, &i->virtual_volume, &remapped_new_volume);
 | 
			
		||||
| 
						 | 
				
			
			@ -1039,7 +1041,7 @@ void pa_sink_update_flat_volume(pa_sink *s, pa_cvolume *new_volume) {
 | 
			
		|||
        /* We don't issue PA_SINK_INPUT_MESSAGE_SET_VOLUME because
 | 
			
		||||
         * we want the update to have atomically with the sink
 | 
			
		||||
         * volume update, hence we do it within the
 | 
			
		||||
         * pa_sink_set_flat_volume() call below*/
 | 
			
		||||
         * pa_sink_set_flat_volume() call below */
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -1061,6 +1063,8 @@ void pa_sink_propagate_flat_volume(pa_sink *s, const pa_cvolume *old_volume) {
 | 
			
		|||
        pa_cvolume remapped_old_volume, remapped_new_volume, fixed_volume;
 | 
			
		||||
        unsigned c;
 | 
			
		||||
 | 
			
		||||
        /* This basically calculates i->virtual_volume := i->virtual_volume * s->virtual_volume / old_volume */
 | 
			
		||||
 | 
			
		||||
        remapped_new_volume = s->virtual_volume;
 | 
			
		||||
        pa_cvolume_remap(&remapped_new_volume, &s->channel_map, &i->channel_map);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -1070,7 +1074,7 @@ void pa_sink_propagate_flat_volume(pa_sink *s, const pa_cvolume *old_volume) {
 | 
			
		|||
        for (c = 0; c < i->sample_spec.channels; c++)
 | 
			
		||||
 | 
			
		||||
            if (remapped_old_volume.values[c] == PA_VOLUME_MUTED)
 | 
			
		||||
                fixed_volume.values[c] = PA_VOLUME_MUTED;
 | 
			
		||||
                fixed_volume.values[c] = remapped_new_volume.values[c];
 | 
			
		||||
            else
 | 
			
		||||
                fixed_volume.values[c] = (pa_volume_t)
 | 
			
		||||
                    ((uint64_t) i->virtual_volume.values[c] *
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue