mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	always remap relative volume properly
This commit is contained in:
		
							parent
							
								
									a998038ee2
								
							
						
					
					
						commit
						dfb3d2ec57
					
				
					 1 changed files with 10 additions and 12 deletions
				
			
		| 
						 | 
					@ -192,7 +192,7 @@ static struct entry* read_entry(struct userdata *u, const char *name) {
 | 
				
			||||||
        goto fail;
 | 
					        goto fail;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if ((e->relative_volume_valid || e->absolute_volume_valid) && !(pa_channel_map_valid(&e->channel_map))) {
 | 
					    if ((e->relative_volume_valid || e->absolute_volume_valid) && !pa_channel_map_valid(&e->channel_map)) {
 | 
				
			||||||
        pa_log_warn("Invalid channel map stored in database for stream %s", name);
 | 
					        pa_log_warn("Invalid channel map stored in database for stream %s", name);
 | 
				
			||||||
        goto fail;
 | 
					        goto fail;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					@ -293,16 +293,14 @@ static void subscribe_callback(pa_core *c, pa_subscription_event_type_t t, uint3
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        entry.channel_map = sink_input->channel_map;
 | 
					        entry.channel_map = sink_input->channel_map;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        pa_sink_input_get_relative_volume(sink_input, &entry.relative_volume);
 | 
				
			||||||
 | 
					        entry.relative_volume_valid = sink_input->save_volume;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (sink_input->sink->flags & PA_SINK_FLAT_VOLUME) {
 | 
					        if (sink_input->sink->flags & PA_SINK_FLAT_VOLUME) {
 | 
				
			||||||
            entry.absolute_volume = *pa_sink_input_get_volume(sink_input);
 | 
					            entry.absolute_volume = *pa_sink_input_get_volume(sink_input);
 | 
				
			||||||
            entry.absolute_volume_valid = sink_input->save_volume;
 | 
					            entry.absolute_volume_valid = sink_input->save_volume;
 | 
				
			||||||
 | 
					        } else
 | 
				
			||||||
            pa_sw_cvolume_divide(&entry.relative_volume, &entry.absolute_volume, pa_sink_get_volume(sink_input->sink, FALSE));
 | 
					            entry.absolute_volume_valid = FALSE;
 | 
				
			||||||
            entry.relative_volume_valid = sink_input->save_volume;
 | 
					 | 
				
			||||||
        } else {
 | 
					 | 
				
			||||||
            entry.relative_volume = *pa_sink_input_get_volume(sink_input);
 | 
					 | 
				
			||||||
            entry.relative_volume_valid = sink_input->save_volume;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        entry.muted = pa_sink_input_get_mute(sink_input);
 | 
					        entry.muted = pa_sink_input_get_mute(sink_input);
 | 
				
			||||||
        entry.muted_valid = sink_input->save_muted;
 | 
					        entry.muted_valid = sink_input->save_muted;
 | 
				
			||||||
| 
						 | 
					@ -528,7 +526,7 @@ static void apply_entry(struct userdata *u, const char *name, struct entry *e) {
 | 
				
			||||||
        if (!(n = get_name(si->proplist, "sink-input")))
 | 
					        if (!(n = get_name(si->proplist, "sink-input")))
 | 
				
			||||||
            continue;
 | 
					            continue;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (strcmp(name, n)) {
 | 
					        if (!pa_streq(name, n)) {
 | 
				
			||||||
            pa_xfree(n);
 | 
					            pa_xfree(n);
 | 
				
			||||||
            continue;
 | 
					            continue;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					@ -578,7 +576,7 @@ static void apply_entry(struct userdata *u, const char *name, struct entry *e) {
 | 
				
			||||||
        if (!(n = get_name(so->proplist, "source-output")))
 | 
					        if (!(n = get_name(so->proplist, "source-output")))
 | 
				
			||||||
            continue;
 | 
					            continue;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (strcmp(name, n)) {
 | 
					        if (!pa_streq(name, n)) {
 | 
				
			||||||
            pa_xfree(n);
 | 
					            pa_xfree(n);
 | 
				
			||||||
            continue;
 | 
					            continue;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue