diff options
author | Wim Taymans <wtaymans@redhat.com> | 2022-07-08 12:02:02 +0200 |
---|---|---|
committer | Philip Langdale <github.philipl@overt.org> | 2022-07-08 07:45:09 -0700 |
commit | c7b17beaf1f3799bf5a1fd3ebe21c9a3e78d48da (patch) | |
tree | f46b527f7b199ed6278a7d4a5a2f22c612d72b69 | |
parent | c01bb44e3619a8a8123b5d2fb04b20f206019f8b (diff) | |
download | mpv-c7b17beaf1f3799bf5a1fd3ebe21c9a3e78d48da.tar.bz2 mpv-c7b17beaf1f3799bf5a1fd3ebe21c9a3e78d48da.tar.xz |
ao_pipewire: pipewire uses linear volume
Don't use cube root volumes, pipewire uses linear volumes.
-rw-r--r-- | audio/out/ao_pipewire.c | 5 |
1 files 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) |