instead of making the volume relative our own, let' pa_sink_input_new() do it for us

This commit is contained in:
Lennart Poettering 2009-01-27 23:55:22 +01:00
parent e439c18785
commit 0f664b7365

View file

@ -392,15 +392,20 @@ static pa_hook_result_t sink_input_fixate_hook_callback(pa_core *c, pa_sink_inpu
if (e->absolute_volume_valid && if (e->absolute_volume_valid &&
e->device_valid && e->device_valid &&
pa_streq(new_data->sink->name, e->device)) pa_streq(new_data->sink->name, e->device)) {
v = e->absolute_volume; v = e->absolute_volume;
else if (e->relative_volume_valid) { new_data->virtual_volume_is_absolute = TRUE;
pa_cvolume t = new_data->sink->virtual_volume; } else if (e->relative_volume_valid) {
pa_sw_cvolume_multiply(&v, &e->relative_volume, pa_cvolume_remap(&t, &new_data->sink->channel_map, &e->channel_map));
v = e->relative_volume;
new_data->virtual_volume_is_absolute = FALSE;
} }
} else if (e->relative_volume_valid) } else if (e->relative_volume_valid) {
v = e->relative_volume; v = e->relative_volume;
new_data->virtual_volume_is_absolute = FALSE;
}
if (v.channels > 0) { if (v.channels > 0) {
pa_log_info("Restoring volume for sink input %s.", name); pa_log_info("Restoring volume for sink input %s.", name);