From c7b17beaf1f3799bf5a1fd3ebe21c9a3e78d48da Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 8 Jul 2022 12:02:02 +0200 Subject: ao_pipewire: pipewire uses linear volume Don't use cube root volumes, pipewire uses linear volumes. --- audio/out/ao_pipewire.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/audio/out/ao_pipewire.c b/audio/out/ao_pipewire.c index 7b31f93283..a7c1e3551a 100644 --- a/audio/out/ao_pipewire.c +++ b/audio/out/ao_pipewire.c @@ -187,13 +187,12 @@ static void on_state_changed(void *userdata, enum pw_stream_state old, enum pw_s static float spa_volume_to_mp_volume(float vol) { - return cbrt(vol) * 100; + return vol * 100; } static float mp_volume_to_spa_volume(float vol) { - vol /= 100; - return vol * vol * vol; + return vol / 100; } static float volume_avg(float* vols, uint32_t n) -- cgit v1.2.3