source-output: Fix source-output volume after move of virtual source stream

When the source-output of a virtual source with volume sharing disabled is moved,
the source output volume is reset to 100%. This patch fixes the problem by
applying the virtual source volume to the source-output after the move.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/509>
This commit is contained in:
Georg Chini 2021-02-17 21:36:07 +01:00
parent b1f599dcd9
commit 6b2844a61d

View file

@ -1512,6 +1512,16 @@ static void update_volume_due_to_moving(pa_source_output *o, pa_source *dest) {
pa_source_output_set_volume_direct(o, &o->reference_ratio);
o->real_ratio = o->reference_ratio;
pa_sw_cvolume_multiply(&o->soft_volume, &o->real_ratio, &o->volume_factor);
/* If this is a virtual source stream, we have to apply the source volume
* to the source output. */
if (o->destination_source) {
pa_cvolume vol;
vol = o->destination_source->real_volume;
pa_cvolume_remap(&vol, &o->destination_source->channel_map, &o->channel_map);
pa_source_output_set_volume(o, &vol, o->destination_source->save_volume, true);
}
}
}