pulse: Use the right conversion functions for volumes

PulseAudio uses cubic volumes and PipeWire uses linear volumes
so use the right conversion functions from one to the other.
This commit is contained in:
Wim Taymans 2020-10-22 19:34:47 +02:00
parent 9c0ff170f9
commit f3dda8e57b
3 changed files with 14 additions and 14 deletions

View file

@ -899,7 +899,7 @@ static int create_stream(pa_stream_direction_t direction,
s->disconnecting = false;
if (volume) {
for (i = 0; i < volume->channels; i++)
s->channel_volumes[i] = volume->values[i] / (float) PA_VOLUME_NORM;
s->channel_volumes[i] = pa_sw_volume_to_linear(volume->values[i]);
s->n_channel_volumes = volume->channels;
} else {
for (i = 0; i < SPA_AUDIO_MAX_CHANNELS; i++)