From 2cc3bc12dbb51ea63cc9ec670bfaf3a574df2fdc Mon Sep 17 00:00:00 2001 From: sunpenghao Date: Tue, 13 Feb 2024 15:32:04 +0800 Subject: [PATCH] ao_wasapi: scale queried AO volume to (0, 100) This was done for `AOCONTROL_SET_VOLUME` but not `AOCONTROL_GET_VOLUME`. --- audio/out/ao_wasapi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/audio/out/ao_wasapi.c b/audio/out/ao_wasapi.c index c6abb16f80..ce9581649f 100644 --- a/audio/out/ao_wasapi.c +++ b/audio/out/ao_wasapi.c @@ -348,7 +348,7 @@ static int thread_control_exclusive(struct ao *ao, enum aocontrol cmd, void *arg case AOCONTROL_GET_VOLUME: IAudioEndpointVolume_GetMasterVolumeLevelScalar( state->pEndpointVolume, &volume); - *(float *)arg = volume; + *(float *)arg = volume * 100.f; return CONTROL_OK; case AOCONTROL_SET_VOLUME: volume = (*(float *)arg) / 100.f; @@ -378,7 +378,7 @@ static int thread_control_shared(struct ao *ao, enum aocontrol cmd, void *arg) switch(cmd) { case AOCONTROL_GET_VOLUME: ISimpleAudioVolume_GetMasterVolume(state->pAudioVolume, &volume); - *(float *)arg = volume; + *(float *)arg = volume * 100.f; return CONTROL_OK; case AOCONTROL_SET_VOLUME: volume = (*(float *)arg) / 100.f;